Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
roelarents committed Nov 22, 2023
1 parent 0760cf9 commit 0cbf2c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tms20/tms20.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func LoadEmbeddedTileMatrixSet(id string) (TileMatrixSet, error) {
if ok {
return *cached, nil
}
tmsJSON, err := embeddedTileMatrixSetsJSONFS.ReadFile(path.Join("tilematrixsets", id+".json"))
tmsJSON, err := embeddedTileMatrixSetsJSONFS.ReadFile(path.Join("tilematrixsets", id+extJSON))
if err != nil {
return tms, err
}
Expand Down Expand Up @@ -610,6 +610,7 @@ type CornerOfOrigin string
const (
TopLeft CornerOfOrigin = "topLeft"
BottomLeft CornerOfOrigin = "bottomLeft"
extJSON = ".json"
)

func (c *CornerOfOrigin) UnmarshalJSONFromMap(data interface{}) error {
Expand Down
6 changes: 3 additions & 3 deletions tms20/tms20_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestLoadEmbeddedTileMatrixSet(t *testing.T) {

remarshalled, err := json.Marshal(&got)
require.NoError(t, err)
rawJSON, err := embeddedTileMatrixSetsJSONFS.ReadFile("tilematrixsets/" + tt.id + ".json")
rawJSON, err := embeddedTileMatrixSetsJSONFS.ReadFile("tilematrixsets/" + tt.id + extJSON)
require.NoError(t, err)
require.JSONEq(t, string(rawJSON), string(remarshalled))

Expand All @@ -67,7 +67,7 @@ func TestLoadJSONTileMatrixSet(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.id, func(t *testing.T) {
jsonFilePath, err := filepath.Abs(path.Join("testdata", tt.id+".json"))
jsonFilePath, err := filepath.Abs(path.Join("testdata", tt.id+extJSON))
require.NoError(t, err)
got, err := LoadJSONTileMatrixSet(jsonFilePath)
require.NoErrorf(t, err, "LoadJSONTileMatrixSet() error = %v", err)
Expand Down Expand Up @@ -215,7 +215,7 @@ func TestTileMatrixSet_ToNative(t *testing.T) {
}

func loadTestOrEmbeddedTileMatrix(id string) (TileMatrixSet, error) {
p, err := filepath.Abs(path.Join("testdata", id+".json"))
p, err := filepath.Abs(path.Join("testdata", id+extJSON))
if err != nil {
return TileMatrixSet{}, err
}
Expand Down

0 comments on commit 0cbf2c9

Please sign in to comment.