Skip to content

Commit

Permalink
feat: move code generator to top-level package
Browse files Browse the repository at this point in the history
Since this is the main feature of this module, and the top-level package
does not contain any other functionalities, this creates a shorter and
easier to remember invocation for the code generator:

```
go run go.einride.tech/spanner-aip generate
```

BREAKING CHANGE: `go.einride.tech/spanner-aip/cmd/spanner-aip-go` is now
                 `go.einride.tech/spanner-aip`.
  • Loading branch information
odsod committed Oct 1, 2021
1 parent ad25f3a commit b9cf77b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ before:
builds:
- id: spanner-aip-go
binary: spanner-aip-go
main: ./cmd/spanner-aip-go/main.go
main: .
env:
- CGO_ENABLED=0
goos:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ go-test:
.PHONY: go-generate
go-generate:
$(info [$@] generating example code...)
@go run ./cmd/spanner-aip-go generate
@go run . generate
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ See [https://aip.dev][google-aip] for the full AIP documentation and the
$ go get -u go.einride.tech/spanner-aip
```

### Code generation
### Code generation config

Use a YAML config file to specify the schema to generate code from:

Expand All @@ -52,6 +52,12 @@ databases:
path: ./internal/examples/musicdb
```
### Code generation
```bash
$ go run go.einride.tech/spanner-aip generate
```

### Reading data

#### Get
Expand Down
5 changes: 0 additions & 5 deletions doc.go

This file was deleted.

File renamed without changes.

0 comments on commit b9cf77b

Please sign in to comment.