How can I replicate this method from Ruby 1.9.3 to Golang 1.7?
require 'digest/sha2'
text = Digest::SHA1.hexdigest("Hello world")
Use crypto/sha1
package main
import (
"crypto/sha1"
"fmt"
)
func main() {
s := sha1.New()
s.Write([]byte("Hello world"))
fmt.Printf("%x", s.Sum(nil))
}