diff --git a/.golangci.yml b/.golangci.yml index 33a5523..29a8677 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,11 +1,10 @@ run: - skip-dirs: - - docs - - datadog - - kustomize - skip-files: - - 'wire_gen.go' tests: false +issues: + exclude-files: + - 'wire_gen.go' + exclude-dirs: + - docs linters-settings: errcheck: check-type-assertions: true diff --git a/schemareg.go b/schemareg.go index f6bc3bc..dbca923 100644 --- a/schemareg.go +++ b/schemareg.go @@ -13,7 +13,7 @@ import ( ) type schemaRegistryFactory struct { - mmu sync.Mutex + m sync.Mutex srCls map[string]schemaregistry.Client } @@ -104,6 +104,9 @@ func (c *schemaRegistryFactory) createJson(srConfig SchemaRegistryConfig) (jsonF } func (c *schemaRegistryFactory) getSchemaClient(srConfig SchemaRegistryConfig) (schemaregistry.Client, error) { + c.m.Lock() + defer c.m.Unlock() + url := srConfig.URL if url == "" { return nil, errors.New("no schema registry url provided")