Skip to content

Commit

Permalink
Rename _example to testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
Nymphium committed May 1, 2024
1 parent afe2eed commit d0c28e1
Show file tree
Hide file tree
Showing 20 changed files with 9 additions and 9 deletions.
4 changes: 0 additions & 4 deletions _example/gen.go

This file was deleted.

6 changes: 3 additions & 3 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestGenerateStructFile(t *testing.T) {
{Validator: true, UseTitle: true, Nullable: true},
}
for _, c := range cases {
fp, err := os.Open("./_example/doc/schema/schema.json")
fp, err := os.Open("./testdata/doc/schema/schema.json")
if err != nil {
t.Fatal(err)
}
Expand All @@ -32,7 +32,7 @@ func TestGenerateStructFile(t *testing.T) {

func TestGenerateJsValValidatorFile(t *testing.T) {
pkg := "taskyapi"
fp, err := os.Open("./_example/doc/schema/schema.json")
fp, err := os.Open("./testdata/doc/schema/schema.json")
if err != nil {
t.Fatal(err)
}
Expand All @@ -45,7 +45,7 @@ func TestGenerateJsValValidatorFile(t *testing.T) {

func TestGenerateValidatorFile(t *testing.T) {
pkg := "taskyapi"
fp, err := os.Open("./_example/doc/schema/schema.json")
fp, err := os.Open("./testdata/doc/schema/schema.json")
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func testNewParser(t *testing.T) *Parser {
sc, err := schema.ReadFile("./_example/doc/schema/schema.json")
sc, err := schema.ReadFile("./testdata/doc/schema/schema.json")
if err != nil {
t.Fatal(err)
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions testdata/gen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package taskyapi

//go:generate go run .. struct --file=./doc/schema/schema.json --package=taskyapi --output=./struct.go
//go:generate go run .. jsval --file=./doc/schema/schema.json --package=taskyapi --output=./validator.go
File renamed without changes.
2 changes: 1 addition & 1 deletion _example/validator.go → testdata/validator.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package taskyapi

import jsval "github.com/lestrrat-go/go-jsval"
import "github.com/lestrrat-go/jsval"

var TaskCreateValidator *jsval.JSVal
var TaskInstancesValidator *jsval.JSVal
Expand Down

0 comments on commit d0c28e1

Please sign in to comment.