Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,18 @@ jobs:
with:
go-version: 1.18

- name: Format check
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "These files are not gofmt-clean:"; echo "$unformatted"; exit 1
fi

- name: Vet
run: go vet ./...

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
run: go test -race -v ./...
1 change: 0 additions & 1 deletion file/textops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"testing"

"github.com/google/go-cmp/cmp"

)

type fakeFiles struct {
Expand Down
18 changes: 9 additions & 9 deletions mod/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ var (
// Mod is used as the accurate representation of what gets printed when
// module creation is done
type Mod struct {
Data types.J
RootRead file.JSONReader
RootWrite file.JSONWriter
Lua file.TextReader
XML file.TextReader
Modsettings file.JSONReader
Objs file.JSONReader
Objdirs file.DirExplorer
SavedObj bool
Data types.J
RootRead file.JSONReader
RootWrite file.JSONWriter
Lua file.TextReader
XML file.TextReader
Modsettings file.JSONReader
Objs file.JSONReader
Objdirs file.DirExplorer
SavedObj bool

// If not-empty: this holds the root filename for the object state json object
OnlyObjStates string
Expand Down
8 changes: 4 additions & 4 deletions mod/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,14 @@ func TestGenerate(t *testing.T) {
{
name: "Saved Object (Simple)",
inputObjs: map[string]types.J{
"test123.json": map[string]interface{}{
"test123.json": map[string]interface{}{
"GUID": "test123",
"Description": "A test object",
},
},
},
},
flags: map[string]interface{}{
"OnlyObjStates": true,
"SavedObj": true,
"SavedObj": true,
},
want: map[string]interface{}{
"SaveName": "",
Expand Down
4 changes: 2 additions & 2 deletions mod/reverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Reverser struct {
RootWrite file.JSONWriter

// If not empty: holds the entire filename (C:...) of the json to read
OnlyObjState string
OnlyObjState string
}

func (r *Reverser) writeOnlyObjStates(raw map[string]interface{}) error {
Expand Down Expand Up @@ -68,7 +68,7 @@ func (r *Reverser) Write(raw map[string]interface{}) error {
}

createdFile := strKey + ext

var jsonInterface map[string]interface{}
err := json.Unmarshal([]byte(strVal), &jsonInterface)
if err == nil {
Expand Down
4 changes: 2 additions & 2 deletions objects/objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func TestObjPrintingToFile(t *testing.T) {
content: types.J{
"acknowledgedUpgradeVersions": []any{},
"optionPanel": map[string]any{
"cardLanguage": string("en"),
"cardLanguage": string("en"),
"changePlayAreaImage": bool(false),
"playAreaConnectionColor": map[string]any{
"a": float64(1),
Expand Down Expand Up @@ -406,7 +406,7 @@ func TestName(t *testing.T) {
guid: "010509",
want: "OccultInvocation!!!!.010509",
}, {
data: types.J{
data: types.J{
"Nickname": "Verschwörung der Äxte!",
"Name": "Card",
},
Expand Down
Loading