Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename _example to testdata #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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.
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
Loading