Skip to content

Commit

Permalink
Make the example runnable and fix go generate syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
liijunwei committed Oct 13, 2024
1 parent 608171a commit 6a89a53
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
all:
@go generate && go build
@go generate && go build . && ./go-event-sourcing-sample

clean:
@rm -f goes
@rm -f *_string.go
@rm -f go-event-sourcing-sample

install-stringer:
@go install golang.org/x/tools/cmd/stringer
8 changes: 4 additions & 4 deletions frequent_flier_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ package main
type Status int

const (
StatusRed Status = iota
StatusSilver Status = iota
StatusGold Status = iota
StatusRed Status = iota
StatusSilver
StatusGold
)

// go:generate stringer -type=Status
//go:generate stringer -type=Status

type FrequentFlierAccountCreated struct {
AccountId string
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/jen20/go-event-sourcing-sample

go 1.23.1
Empty file added go.sum
Empty file.
15 changes: 12 additions & 3 deletions status_string.go

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

0 comments on commit 6a89a53

Please sign in to comment.