protoc

command module
v0.0.0-...-b16e635 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

protoc

To use protoc-gen-gorm with protoc, make sure protoc-gen-gorm is in your path (see Install) and invoke protoc with --gorm_out=dir, where dir is your desired output directory for the files that protoc-gen-gorm generates.

For this example we invoke (go generate):

protoc -Iprotos --go_out=./ --gorm_out=./ protos/models.proto

This compiles our GORM v2 model (and Go bindings) that we make use of in main.go:

alice := &pb.UserModel{Name: "Alice"}
db.Create(alice)

When run:

$ go generate
$ go run main.go
...
Created first user: Alice

$ go run main.go
The first user is: Alice

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL