From 93f547380e454dcd3314f0049149cd2a7235b809 Mon Sep 17 00:00:00 2001 From: omissis Date: Mon, 1 May 2023 16:09:46 +0200 Subject: [PATCH] chore: fix linting issues --- .tool-versions | 2 +- pkg/codegen/utils.go | 2 ++ pkg/generator/generate.go | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.tool-versions b/.tool-versions index 1669b5c6..2f119f4e 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,6 +1,6 @@ adr-tools 3.0.0 golang 1.20.3 -golangci-lint 1.52.1 +golangci-lint 1.52.2 goreleaser 1.17.1 hadolint 2.12.0 shellcheck 0.9.0 diff --git a/pkg/codegen/utils.go b/pkg/codegen/utils.go index 293bffe9..6ce07f59 100644 --- a/pkg/codegen/utils.go +++ b/pkg/codegen/utils.go @@ -34,6 +34,7 @@ func isPointerType(t Type) bool { func PrimitiveTypeFromJSONSchemaType(jsType, format string, pointer bool) (Type, error) { var t Type + switch jsType { case schemas.TypeNameString: switch format { @@ -51,6 +52,7 @@ func PrimitiveTypeFromJSONSchemaType(jsType, format string, pointer bool) (Type, Name: "Addr", }, } + default: t = PrimitiveType{"string"} } diff --git a/pkg/generator/generate.go b/pkg/generator/generate.go index e8d8f38f..8f3212d3 100644 --- a/pkg/generator/generate.go +++ b/pkg/generator/generate.go @@ -729,6 +729,7 @@ func (g *schemaGenerator) generateType( for _, imprt := range ncg.Package.Imports { g.output.file.Package.AddImport(imprt.QualifiedName, "") } + return ncg, nil } @@ -891,6 +892,7 @@ func (g *schemaGenerator) generateTypeInline( for _, imprt := range ncg.Package.Imports { g.output.file.Package.AddImport(imprt.QualifiedName, "") } + return ncg, nil }