summaryrefslogtreecommitdiff
path: root/git.go
diff options
context:
space:
mode:
authorKirill <[email protected]>2021-11-08 17:38:55 +0300
committerGitHub <[email protected]>2021-11-08 06:38:55 -0800
commit5e35338d58b589939b599c98ec9e6b44f94de20a (patch)
tree2cfd09de36ac1488d0662c0ac37ddf0caefccc42 /git.go
parent533c82f2707b8ad2f0f667867b3ea91ec08667aa (diff)
Generate stringer files automatically (#841)
Added `stringer` annotations to `git.go` for `ErrorClass` and `ErrorCode`. Added `generate` rule for `Makefile` to generate string representations for these types (first building cgo files in `_obj` dir to get C constants). Finally, updated `ci` actions workflow to check that generated files are up to date. Fixes: #543
Diffstat (limited to 'git.go')
-rw-r--r--git.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/git.go b/git.go
index 383c492..b7c8b3c 100644
--- a/git.go
+++ b/git.go
@@ -14,6 +14,7 @@ import (
"unsafe"
)
+//go:generate stringer -type ErrorClass -trimprefix ErrorClass -tags static
type ErrorClass int
const (
@@ -48,6 +49,7 @@ const (
ErrorClassPatch ErrorClass = C.GIT_ERROR_PATCH
)
+//go:generate stringer -type ErrorCode -trimprefix ErrorCode -tags static
type ErrorCode int
const (