Skip to content

Instantly share code, notes, and snippets.

@liampulles
Last active July 9, 2022 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liampulles/ae4ab6989b0f80f09306aa52be9537fe to your computer and use it in GitHub Desktop.
Save liampulles/ae4ab6989b0f80f09306aa52be9537fe to your computer and use it in GitHub Desktop.
Golang implementation check example
type Hashable interface {
Hash() []byte
}
type BasicThingy string
type StructThingy struct{}
// Implementation checks:
var _ Hashable = (BasicThingy)("")
var _ Hashable = &StructThingy{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment