Unresolved reference 'DigestSHA256Sum'
9thwall opened this issue · comments
Leo9 commented
Sorry for this noob issue but I'm getting 'Unresolved reference 'DigestSHA256Sum' setting up a simple test. What am I missing?
package main
import (
"fmt"
"github.com/Luzifer/go-openssl"
)
func main() {
opensslEncrypted := "myencryptedstring"
passphrase := "mypassphrase"
o := openssl.New()
dec, err := o.DecryptBytes(passphrase, []byte(opensslEncrypted), DigestSHA256Sum)
if err != nil {
fmt.Printf("An error occurred: %s\n", err)
}
fmt.Printf("Decrypted text: %s\n", string(dec))
}
Knut Ahlers commented
You are trying to use a variable / constant from your own package (main
) with the name DigestSHA256Sum
. As this constant is declared in the openssl
package you need to reference it as openssl.DigestSHA256Sum
…
In the examples and test-code this is possible as those examples already are inside the openssl
package.
Leo9 commented
Thank you! That did it.