mirror of https://github.com/k3s-io/k3s
Clean up genswaggertypedocs.
These are based on recommendation from [staticcheck](http://staticcheck.io/).k3s-v1.15.3
parent
8f5a62af48
commit
fd5113aec1
|
@ -54,7 +54,7 @@ func main() {
|
|||
|
||||
docsForTypes := kruntime.ParseDocumentationFrom(*typeSrc)
|
||||
|
||||
if *verify == true {
|
||||
if *verify {
|
||||
rc, err := kruntime.VerifySwaggerDocsExist(docsForTypes, funcOut)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error in verification process: %s\n", err)
|
||||
|
@ -62,7 +62,7 @@ func main() {
|
|||
os.Exit(rc)
|
||||
}
|
||||
|
||||
if docsForTypes != nil && len(docsForTypes) > 0 {
|
||||
if len(docsForTypes) > 0 {
|
||||
if err := kruntime.WriteSwaggerDocFunc(docsForTypes, funcOut); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when writing swagger documentation functions: %s\n", err)
|
||||
os.Exit(-1)
|
||||
|
|
Loading…
Reference in New Issue