diff options
author | Abhinav Gupta <mail@abhinavg.net> | 2021-11-27 16:51:55 -0800 |
---|---|---|
committer | Abhinav Gupta <mail@abhinavg.net> | 2021-11-27 16:51:55 -0800 |
commit | fe308ea0d0ff6c31f2a218f8b47d8ace124ea679 (patch) | |
tree | 2439ef882d553ab0bec10e1cbb81aa2d4a5bbf06 /plumbing | |
parent | e4fcd078d42e945581616855ab78d8b7ed12df6c (diff) | |
download | go-git-fe308ea0d0ff6c31f2a218f8b47d8ace124ea679.tar.gz |
packp: Actions should have type Action
Per the [Go Spec](https://go.dev/ref/spec#Constant_declarations),
the following yields the type `Action` for `Bar` and `Baz`
only if there is no `=`.
const (
Foo Action = ...
Bar
Baz
)
The following has the type `Action` for the first item,
but not the rest. Those are untyped constants
of the corresponding type.
const (
Foo Action = ...
Bar = ...
Baz = ...
)
This means that `packp.{Update, Delete, Invalid}` are currently
untyped string constants, and not `Action` constants
as was intended here.
This change fixes these.
Diffstat (limited to 'plumbing')
-rw-r--r-- | plumbing/protocol/packp/updreq.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plumbing/protocol/packp/updreq.go b/plumbing/protocol/packp/updreq.go index 46ad6fd..5dbd8ac 100644 --- a/plumbing/protocol/packp/updreq.go +++ b/plumbing/protocol/packp/updreq.go @@ -87,9 +87,9 @@ type Action string const ( Create Action = "create" - Update = "update" - Delete = "delete" - Invalid = "invalid" + Update Action = "update" + Delete Action = "delete" + Invalid Action = "invalid" ) type Command struct { |