diff --git a/README.md b/README.md index 79a75d3..f5813b9 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ struct { ### Label as ID field ```go -struct { +struct Foo { // Notice the "," before the id Id string `gq:",id"` @@ -158,6 +158,13 @@ struct { // NOTE NUMBERS WILL BE CONVERTED TO STRINGS IN OUTPUT PostId *int `gq:",id"` } + +// Label method response as ID using AttrIsID +// The value returned for AttrIsID is ignored +// You can also still just fine append an error: (string, AttrIsID, error) +func (Foo) ResolveExampleMethod() (string, AttrIsID) { + return "i'm an ID type", 0 +} ``` ### Methods and field arguments