Skip to content

Commit cf2eedc

Browse files
committed
Apply new lint rules
1 parent a2c657a commit cf2eedc

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

schemas.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package spaceapiValidator
1+
package spaceapivalidator
22

33
// CommitHash contains the hash of the commit the Validate function validates against
44
var CommitHash = "377001fa1abb25d8988f187e7ad4d40d900d81b8"
55

6-
// SpaceApiSchemas load from the repository as a map
7-
var SpaceApiSchemas = map[string]string{
6+
// SpaceAPISchemas load from the repository as a map
7+
var SpaceAPISchemas = map[string]string{
88
"11": `{
99
"$id": "https://schema.spaceapi.io/11.json",
1010
"$schema": "http://json-schema.org/draft-07/schema#",

scripts/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func getSchemaFiles() []githubFile {
7272

7373
func writeSchemaGoFile(commitHash string, files []githubFile) {
7474
out, _ := os.Create("schemas.go")
75-
out.Write([]byte("package spaceapiValidator\n\n// CommitHash contains the hash of the commit the Validate function validates against\nvar CommitHash = \"" + commitHash + "\"\n\n// SpaceApiSchemas load from the repository as a map\nvar SpaceApiSchemas = map[string]string{\n"))
75+
out.Write([]byte("package spaceapivalidator\n\n// CommitHash contains the hash of the commit the Validate function validates against\nvar CommitHash = \"" + commitHash + "\"\n\n// SpaceAPISchemas load from the repository as a map\nvar SpaceAPISchemas = map[string]string{\n"))
7676
for _, f := range files {
7777
if strings.HasSuffix(f.Name, ".json") {
7878
fileContent, err := b64.StdEncoding.DecodeString(f.Content)

spaceapi_validator.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package spaceapiValidator
1+
package spaceapivalidator
22

33
import (
44
"encoding/json"
@@ -9,8 +9,8 @@ import (
99

1010
//go:generate go run scripts/generate.go
1111

12-
type spaceApiVersion struct {
13-
Api string
12+
type spaceAPIVersion struct {
13+
API string
1414
}
1515

1616
// ResultError tells you whats wrong with specific attributes of your SpaceApi file
@@ -35,12 +35,12 @@ func Validate(document string) (ValidationResult, error) {
3535
}
3636
documentLoader := gojsonschema.NewStringLoader(document)
3737

38-
suppliedVersion := spaceApiVersion{}
38+
suppliedVersion := spaceAPIVersion{}
3939
json.Unmarshal([]byte(document), &suppliedVersion)
4040

41-
schemaString, ok := SpaceApiSchemas[strings.Replace(suppliedVersion.Api, "0.", "", 1)]
41+
schemaString, ok := SpaceAPISchemas[strings.Replace(suppliedVersion.API, "0.", "", 1)]
4242
if !ok {
43-
schemaString = SpaceApiSchemas["13"]
43+
schemaString = SpaceAPISchemas["13"]
4444
}
4545
var schema = gojsonschema.NewStringLoader(schemaString)
4646

spaceapi_validator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package spaceapiValidator
1+
package spaceapivalidator
22

33
import (
44
"testing"

0 commit comments

Comments
 (0)