Skip to content

Commit

Permalink
Merge pull request #25 from mkouhei/fixes-golint-violations
Browse files Browse the repository at this point in the history
Fixes golint violations
  • Loading branch information
mkouhei committed Mar 4, 2017
2 parents e4fa6f2 + 0070bfa commit 02dc25e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 30 deletions.
26 changes: 8 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
language: go
sudo: false

matrix:
include:
- go: "1.2"
before_install:
- go get code.google.com/p/go.tools/cmd/cover
- go get code.google.com/p/go.tools/cmd/goimports
- go: "1.3"
before_install:
- go get code.google.com/p/go.tools/cmd/cover
- go get code.google.com/p/go.tools/cmd/goimports
- go: "1.4"
before_install:
- go get golang.org/x/tools/cmd/cover
- go get golang.org/x/tools/cmd/goimports
- go: "tip"
before_install:
- go get golang.org/x/tools/cmd/cover
- go get golang.org/x/tools/cmd/goimports
go:
- 1.5
- 1.6
- 1.7
- 1.8
- tip

install:
- go get golang.org/x/tools/cmd/goimports
- go get github.com/mattn/goveralls
- go get -d -v ./...
script:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ prebuild: $(SRC)
$(PREBUILD_CMD)

build: prebuild
go build -ldflags "-X main.ver $(shell git describe --always)" -o _build/$(BIN)
go build -ldflags "-X main.ver=$(shell git describe --always)" -o _build/$(BIN)

build-only: $(SRC)
go build -ldflags "-X main.ver $(shell git describe --always)" -o _build/$(BIN)
go build -ldflags "-X main.ver=$(shell git describe --always)" -o _build/$(BIN)

prebuild-docs:
@if [ -d $(CURDIR)/docs ] && [ -f $(CURDIR)/docs/requirements.txt ]; then \
Expand Down
2 changes: 1 addition & 1 deletion env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestNewEnv(t *testing.T) {
cleanDir(e.bldDir)
}

func Example_CheckInst() {
func CheckInst() {
p := os.Getenv("PATH")
os.Setenv("PATH", "")
go checkInst()
Expand Down
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"time"
)

func Example_MainVersion() {
func MainVersion() {
os.Args = append(os.Args, "-version")
os.Args = append(os.Args, "-c")
main()
Expand All @@ -31,7 +31,7 @@ func Example_MainVersion() {
time.Sleep(time.Microsecond)
}

func Example_Run() {
func Run() {
goVer = "go version goX.X.X\n"
ver = "x.x.x"
run(false, "")
Expand Down
12 changes: 5 additions & 7 deletions shell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ import (

var (
testSrc = `package main
import (
"fmt"
"os"
)
import "fmt"
func main() {
fmt.Println("hello")
}
Expand Down Expand Up @@ -169,7 +167,7 @@ func TestRead(t *testing.T) {
os.Remove("dummy_code")
}

func ExampleGoGet() {
func GoGet() {
e := newEnv(false, "")
imptQ := make(chan imptSpec, 1)
imptQ <- imptSpec{"fmt", ""}
Expand All @@ -178,7 +176,7 @@ func ExampleGoGet() {
//
}

func ExampleGoRun() {
func GoRun() {
e := newEnv(true, "")
fp, err := os.OpenFile(e.tmpPath, os.O_WRONLY|os.O_CREATE, 0600)
if err != nil {
Expand All @@ -199,7 +197,7 @@ func ExampleGoRun() {

}

func ExampleGoRunFail() {
func GoRunFail() {
e := newEnv(false, "")
e.goRun()
// Output:
Expand Down

0 comments on commit 02dc25e

Please sign in to comment.