Skip to content

Commit

Permalink
Merge pull request #92 from cockroachdb/lint
Browse files Browse the repository at this point in the history
add some linting to travis
  • Loading branch information
maddyblue authored May 2, 2019
2 parents 392e747 + ba152df commit 39b1e70
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
language: go

go:
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x

script: go test
before_install:
- go get golang.org/x/lint/golint
- go get honnef.co/go/tools/cmd/staticcheck

script:
- go test
- golint .
- staticcheck .
15 changes: 0 additions & 15 deletions decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,6 @@ func (c *Context) SetString(d *Decimal, s string) (*Decimal, Condition, error) {
return d, res, err
}

func (d *Decimal) strSpecials() (bool, string) {
switch d.Form {
case NaN:
return true, "NaN"
case NaNSignaling:
return true, "sNaN"
case Infinite:
return true, "Infinity"
case Finite:
return false, ""
default:
return true, "unknown"
}
}

// Set sets d's fields to the values of x and returns d.
func (d *Decimal) Set(x *Decimal) *Decimal {
if d == x {
Expand Down
6 changes: 3 additions & 3 deletions decomposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

package apd

import (
"fmt"
)
import "fmt"

// decomposer composes or decomposes a decimal value to and from individual parts.
// There are four separate parts: a boolean negative flag, a form byte with three possible states
Expand Down Expand Up @@ -48,6 +46,8 @@ type decomposer interface {
Compose(form byte, negative bool, coefficient []byte, exponent int32) error
}

var _ decomposer = &Decimal{}

// Decompose returns the internal decimal state into parts.
// If the provided buf has sufficient capacity, buf may be returned as the coefficient with
// the value set and length set as appropriate.
Expand Down

0 comments on commit 39b1e70

Please sign in to comment.