Skip to content

feat/fix: multiple ci fixes, publish docker images #1380

feat/fix: multiple ci fixes, publish docker images

feat/fix: multiple ci fixes, publish docker images #1380

Triggered via pull request June 22, 2023 04:17
Status Success
Total duration 2m 46s
Artifacts

release.yml

on: pull_request
Matrix: test
release
0s
release
Fit to window
Zoom out
Zoom in

Annotations

1 error
test (1.20.x, ubuntu-latest)
cannot use EnumFirst (type uint8) as type int in assignment\n```\n\n\n## Losing method sets\n\nA more subtle issue occurs with types that have methods and optional interfaces. Consider the following:\n\n```go\npackage main\n\nimport \"fmt\"\n\ntype Enum int\n\nfunc (e Enum) String() string {\n return \"an enum\"\n}\n\nconst (\n EnumFirst Enum = 1\n EnumSecond = 2\n)\n\nfunc main() {\n fmt.Println(EnumFirst)\n fmt.Println(EnumSecond)\n}\n```\n\nThis code will output\n\n```go\nan enum\n2\n```\n\nas `EnumSecond` has no explicit type, and thus defaults to `int`.\n\n\n"},"helpUri":"https://staticcheck.io/docs/checks#SA9004","defaultConfiguration":{"enabled":true,"level":"warning"}},{"id":"SA4003","shortDescription":{"text":"Comparing unsigned values against negative values is pointless","markdown":"Comparing unsigned values against negative values is pointless"},"help":{"text":"Comparing unsigned values against negative values is pointless\n\n\n","markdown":"Comparing unsigned values against negative values is pointless\n\n\n"},"helpUri":"https://staticcheck.io/docs/checks#SA4003","defaultConfiguration":{"enabled":true,"level":"warning"}},{"id":"SA4023","shortDescription":{"text":"Impossible comparison of interface value with untyped nil","markdown":"Impossible comparison of interface value with untyped nil"},"help":{"text":"Impossible comparison of interface value with untyped nil\n\nUnder the covers, interfaces are implemented as two elements, a type T and a value V. V is a concrete value such as an int, struct or pointer, never an interface itself, and has type T. For instance, if we store the int value 3 in an interface, the resulting interface value has, schematically, (T=int, V=3). The value V is also known as the interface's dynamic value, since a given interface variable might hold different values V (and corresponding types T) during the execution of the program.\n\nAn interface value is nil only if the V and T are both unset, (T=nil, V is not set), In particular, a nil interface will always hold a nil type. If we store a nil pointer of type *int inside an interface value, the inner type will be *int regardless of the value of the pointer: (T=*int, V=nil). Such an interface value will therefore be non-nil even when the pointer value V inside is nil.\n\nThis situation can be confusing, and arises when a nil value is stored inside an interface value such as an error return:\n\n```go\nfunc returnsError() error {\n var p *MyError = nil\n if bad() {\n p = ErrBad\n }\n return p // Will always return a non-nil error.\n}\n```\n\nIf all goes well, the function returns a nil p, so the return value is an error interface value holding (T=*MyError, V=nil). This means that if the caller compares the returned error to nil, it will always look as if there was an error even if nothing bad happened. To return a proper nil error to the caller, the function must return an explicit nil:\n\n```go\nfunc returnsError() error {\n if bad() {\n return ErrBad\n }\n return nil\n}\n```\n\nIt's a good idea for functions that return errors always to use the error type in their signature (as we did above) rather than a concrete type such as *MyError, to help guarantee the error is created correctly. As an example, os.Open returns an error even though, if not nil, it's always of concrete type *os.PathError.\n\nSimilar situations to those described here can arise whenever interfaces are used. Just keep in mind that if any concrete value has been stored in the interface, the interface will not be nil. For more information, see The Laws of Reflection (https://golang.org/doc/articles/laws_of_reflection.html).\n\nThis text has been copied from https://golang.org/doc/faq#nil_error, licensed under the Creative Commons Attribution 3.0 License.\n\n\n","markdown":"Impossible comparison of interface value with untyped nil\n\nUnder the covers, interfaces are implemented as two elements, a type T and a value V. V is a concrete value such as an int, struct or pointer, never an interface itself, and has type T