Skip to content

Commit

Permalink
Improve TypeID interfaces (#195)
Browse files Browse the repository at this point in the history
## Summary
Improvements to TypeID interfaces:
- Add all the standard TypeID methods to the `Subtype` interfaces. When
changing code in axiom, noticed that would be useful.
- Make `SubtypePtr` public. Occasionally useful, if one needs to create
a 'constructor'-like function outside the `typeid` package.
- Rename `Type()` to `Prefix()`. Been wanting to do this change before.
After using typeids, I think `Prefix()` feels more natural and it pairs
nicely with the existing `Suffix()`. This change is *not* backwards
compatible, but neither was the generics change we did. I'm hoping I can
get this in now, and then tag the next release as `v1`.

## How was it tested?
Ran all tests.
  • Loading branch information
loreto committed Nov 19, 2023
1 parent f1dcf47 commit bff53de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func decodeCmd(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
cmd.Printf("type: %s\n", tid.Type())
cmd.Printf("type: %s\n", tid.Prefix())
cmd.Printf("uuid: %s\n", tid.UUID())
return nil
}

0 comments on commit bff53de

Please sign in to comment.