mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-04 17:06:49 +00:00
New lint rules
This commit is contained in:
@ -2,6 +2,7 @@ package dnsproviders
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"npm/internal/errors"
|
||||
)
|
||||
|
||||
@ -31,8 +32,8 @@ type Provider struct {
|
||||
Properties map[string]providerField `json:"properties"`
|
||||
}
|
||||
|
||||
// GetJsonSchema encodes this object as JSON string
|
||||
func (p *Provider) GetJsonSchema() (string, error) {
|
||||
// GetJSONSchema encodes this object as JSON string
|
||||
func (p *Provider) GetJSONSchema() (string, error) {
|
||||
b, err := json.Marshal(p)
|
||||
return string(b), err
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
package dnsproviders
|
||||
|
||||
import (
|
||||
"npm/internal/util"
|
||||
"testing"
|
||||
|
||||
"npm/internal/util"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
@ -13,7 +14,7 @@ func TestAcmeDNSProvider(t *testing.T) {
|
||||
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
|
||||
|
||||
provider := getDNSAcmeDNS()
|
||||
json, err := provider.GetJsonSchema()
|
||||
json, err := provider.GetJSONSchema()
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, `{
|
||||
"title": "dns_acmedns",
|
||||
|
@ -1,9 +1,10 @@
|
||||
package dnsproviders
|
||||
|
||||
import (
|
||||
"npm/internal/util"
|
||||
"testing"
|
||||
|
||||
"npm/internal/util"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
@ -14,7 +15,7 @@ func TestAdProvider(t *testing.T) {
|
||||
|
||||
provider := getDNSAd()
|
||||
provider.ConvertToUpdatable()
|
||||
json, err := provider.GetJsonSchema()
|
||||
json, err := provider.GetJSONSchema()
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, `{
|
||||
"title": "dns_ad",
|
||||
|
@ -1,9 +1,10 @@
|
||||
package dnsproviders
|
||||
|
||||
import (
|
||||
"npm/internal/util"
|
||||
"testing"
|
||||
|
||||
"npm/internal/util"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
@ -13,7 +14,7 @@ func TestAliProvider(t *testing.T) {
|
||||
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
|
||||
|
||||
provider := getDNSAli()
|
||||
json, err := provider.GetJsonSchema()
|
||||
json, err := provider.GetJSONSchema()
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, `{
|
||||
"title": "dns_ali",
|
||||
|
Reference in New Issue
Block a user