Companion to a blog post: Deriving Safe ID Types in Go.
- Select an implementation to test: comment/uncomment
widgetimports in widget_test.go. - Run the tests:
go test widget_test.go.
| Approach (blog post) | Package |
|---|---|
Defining a new string type |
pkg/string_type |
Embedding uuid.UUID |
pkg/uuid_embed |
Defining a new uuid.UUID type |
pkg/uuid_type |
Aliasing uuid.UUID |
pkg/uuid_alias |