Skip to content

Commit

Permalink
Example: Add uuid.UUID type and regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek committed Jul 18, 2023
1 parent e27067b commit da9ff3f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
13 changes: 8 additions & 5 deletions _examples/golang-basics/example.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions _examples/golang-basics/example.ridl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ enum Kind: uint32

struct User
- id: uint64
+ json = id
+ go.field.name = ID
#+ go.field.type = int64
+ go.tag.db = id

- uuid: string
+ go.tag.db = id
+ go.field.type = uuid.UUID
+ go.type.import = github.com/google/uuid

- username: string
+ json = USERNAME
+ go.tag.db = username
Expand Down
1 change: 1 addition & 0 deletions _examples/golang-basics/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
2 changes: 2 additions & 0 deletions _examples/golang-basics/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-chi/chi/v5 v5.0.7 h1:rDTPXLDHGATaeHvVlLcR4Qe0zftYethFucbjVQ1PxU8=
github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
1 change: 1 addition & 0 deletions _examples/golang-basics/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:generate webrpc-gen -schema=example.ridl -test
//go:generate webrpc-gen -schema=example.ridl -target=../../../gen-golang -pkg=main -server -client -out=./example.gen.go -fmt=false -legacyErrors=true
package main

Expand Down

0 comments on commit da9ff3f

Please sign in to comment.