diff --git a/.gitignore b/.gitignore index 6ad1902..689c20e 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ go.work # Build artifacts _build/ +pub/ # OS Stuff .DS_Store diff --git a/internal/wasm/wasm.go b/internal/wasm/wasm.go index 368a6e5..dd668d4 100644 --- a/internal/wasm/wasm.go +++ b/internal/wasm/wasm.go @@ -4,26 +4,21 @@ package main import ( "encoding/json" "fmt" - "log" "github.com/theory/jsonpath" ) func main() { // Parse a jsonpath query. - p, err := jsonpath.Parse(`$.foo`) - if err != nil { - log.Fatal(err) - } + p, _ := jsonpath.Parse(`$.foo`) // Select values from unmarshaled JSON input. result := p.Select([]byte(`{"foo": "bar"}`)) // Show the result. - items, err := json.Marshal(result) - if err != nil { - log.Fatal(err) - } + //nolint:errchkjson + items, _ := json.Marshal(result) + //nolint:forbidigo fmt.Printf("%s\n", items) } diff --git a/internal/wasm/wasm_test.go b/internal/wasm/wasm_test.go new file mode 100644 index 0000000..dba06b0 --- /dev/null +++ b/internal/wasm/wasm_test.go @@ -0,0 +1,10 @@ +package main + +import ( + "testing" +) + +func TestMain(t *testing.T) { + t.Parallel() + main() +}