Skip to content

Commit

Permalink
gofmt fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
qiangxue committed Dec 4, 2019
1 parent 5ab03e7 commit 083f0b2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ install:
- go get golang.org/x/lint/golint

script:
- test -z "`gofmt -l .`"
- test -z "`gofmt -l -d .`"
- test -z "`golint ./...`"
- go test -v -covermode=count -coverprofile=coverage.out
- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Example_second() {
err := validation.Validate(data,
validation.Required, // not empty
validation.Length(5, 100), // length between 5 and 100
is.URL, // is a valid URL
is.URL, // is a valid URL
)
fmt.Println(err)
// Output:
Expand Down
6 changes: 3 additions & 3 deletions multipleof.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// MultipleOf returns a validation rule that checks if a value is a multiple of the "base" value.
// Note that "base" should be of integer type.
// Note that "base" should be of integer type.
func MultipleOf(base interface{}) *MultipleOfRule {
return &MultipleOfRule{
base,
Expand All @@ -17,8 +17,8 @@ func MultipleOf(base interface{}) *MultipleOfRule {

// MultipleOfRule is a validation rule that checks if a value is a multiple of the "base" value.
type MultipleOfRule struct {
base interface{}
message string
base interface{}
message string
}

// Error sets the error message for the rule.
Expand Down
4 changes: 2 additions & 2 deletions validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (
// Skip is a special validation rule that indicates all rules following it should be skipped.
Skip = &skipRule{}

validatableType = reflect.TypeOf((*Validatable)(nil)).Elem()
validatableType = reflect.TypeOf((*Validatable)(nil)).Elem()
validatableWithContextType = reflect.TypeOf((*ValidatableWithContext)(nil)).Elem()
)

Expand Down Expand Up @@ -235,7 +235,7 @@ func (r *skipRule) Validate(interface{}) error {
}

type inlineRule struct {
f RuleFunc
f RuleFunc
fc RuleWithContextFunc
}

Expand Down
8 changes: 4 additions & 4 deletions validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ func TestValidate(t *testing.T) {
withCtx StringValidateContext = "xyz"
)
tests := []struct {
tag string
value interface{}
err string
tag string
value interface{}
err string
errWithContext string
}{
{"t1", 123, "", ""},
Expand Down Expand Up @@ -102,7 +102,7 @@ func TestBy(t *testing.T) {
assert.Nil(t, Validate("xyz", xyzRule))
assert.NotNil(t, Validate("abc", xyzRule))
assert.Nil(t, ValidateWithContext(context.Background(), "xyz", xyzRule))
assert.NotNil(t, ValidateWithContext(context.Background(),"abc", xyzRule))
assert.NotNil(t, ValidateWithContext(context.Background(), "abc", xyzRule))
}

type key int
Expand Down

0 comments on commit 083f0b2

Please sign in to comment.