Go ships its cryptography in the standard library, and since Go 1.24 the core primitives live in the Go Cryptographic Module built for FIPS 140-3. crypto/ecdsa signs and verifies, crypto/x509 reads keys and certificates, and Go 1.27.3 adds crypto/mlkem (ML-KEM-768/1024) and crypto/mldsa (ML-DSA-44/65/87) next to crypto/ed25519. There is no secp256k1: Ethereum and Bitcoin code uses go-ethereum's or decred's packages.
Everything in crypto/ecdsa operates on a digest you computed — the package never hashes. Worse than a wrong signature, a long input is silently truncated to the curve size: a signature over a 46-byte input verified for a different input with the same first 32 bytes. Always hash first, as the sample does. SignASN1, VerifyASN1 and the crypto.Signer interface speak ASN.1 DER; WebCrypto, JWS and other raw r‖s peers need Sign/Verify with the integers padded by FillBytes — Bytes() drops leading zero bytes, so every r or s that happens to start with a zero byte comes out one byte short.
Signatures are randomized and, since Go 1.26, the io.Reader you pass is ignored unless GODEBUG=cryptocustomrand=1 is set: two signatures made with an all-zero Reader differed. Tests that relied on a fixed Reader to get reproducible signatures stopped working; the documented replacement is testing/cryptotest.SetGlobalRandom. s is not normalized and VerifyASN1 accepts both halves, so signatures for strict low-S verifiers need s replaced by n − s.
Key parsing is DER-first. x509.ParsePKIXPublicKey given PEM text fails with asn1: structure error: tags don't match — call pem.Decode first. ecdsa.ParseUncompressedPublicKey and ecdsa.ParseRawPrivateKey read the bare SEC1 point and scalar; compressed points are refused, and there is no reader for passphrase-encrypted PKCS#8. A malformed signature makes VerifyASN1 return false, never an error.
To compare a Go signature with another stack, convert it in the DER ⇄ raw converter and check it in the signature verifier; certificate parsing problems are easiest to see in the certificate decoder.