Skip to content

Commit

Permalink
gomodules (#32)
Browse files Browse the repository at this point in the history
* no vendor dir
* Fixes from #31 (README changes)
  • Loading branch information
abice committed Apr 5, 2019
1 parent 835e766 commit c5b07cc
Show file tree
Hide file tree
Showing 2,069 changed files with 94 additions and 553,265 deletions.
19 changes: 7 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ version: 2


common_parts: &common_parts
working_directory: /go/src/github.com/abice/go-enum
steps:
- checkout
- run:
name: Install Go Deps
command: |
go get -v github.com/jteeuwen/go-bindata/... golang.org/x/tools/cmd/cover github.com/mattn/goveralls github.com/modocache/gover github.com/golang/mock/gomock
go install -v github.com/kevinburke/go-bindata/go-bindata golang.org/x/tools/cmd/cover github.com/mattn/goveralls github.com/golang/mock/gomock
go install github.com/golang/mock/mockgen
- run:
name: Build
Expand All @@ -18,26 +17,22 @@ common_parts: &common_parts
name: Test
command: |
make cover
make coveralls
jobs:
golang_1.9:
<<: *common_parts
docker:
- image: circleci/golang:1.9
golang_1.10:
docker:
- image: circleci/golang:1.10
<<: *common_parts
golang_1.11:
docker:
- image: circleci/golang:1.11
<<: *common_parts
golang_1.12:
docker:
- image: circleci/golang:1.12
<<: *common_parts

workflows:
version: 2
build_and_test:
jobs:
- golang_1.9
- golang_1.10
- golang_1.11
- golang_1.12
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@

/bin
/coverage
vendor/
coverage.out
coverage.html
207 changes: 0 additions & 207 deletions Gopkg.lock

This file was deleted.

40 changes: 0 additions & 40 deletions Gopkg.toml

This file was deleted.

25 changes: 9 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ endif
PACKAGES='./generator' './example'

.PHONY: all
all: build fmt test example cover install
all: build fmt test example cover install

.PHONY: install-deps
install-deps:
go get github.com/golang/dep/cmd/dep
go get -v github.com/jteeuwen/go-bindata/...
go get -v golang.org/x/tools/cmd/cover
go get -v github.com/mattn/goveralls
go get -v github.com/modocache/gover
dep ensure
go install -v github.com/jteeuwen/go-bindata/go-bindata
go install -v golang.org/x/tools/cmd/cover
go install -v github.com/mattn/goveralls
go mod vendor

build:
go generate ./generator
Expand All @@ -28,19 +26,14 @@ fmt:
gofmt -l -w -s $$(find . -type f -name '*.go' -not -path "./vendor/*")

test: gen-test generate
if [ ! -d coverage ]; then mkdir coverage; fi
go test -v ./generator -race -cover -coverprofile=$(COVERAGEDIR)/generator.coverprofile
go test -v ./example -race -cover -coverprofile=$(COVERAGEDIR)/example.coverprofile
go test -v ./... -race -coverprofile=coverage.out

cover: gen-test test
go tool cover -html=$(COVERAGEDIR)/generator.coverprofile -o $(COVERAGEDIR)/generator.html
go tool cover -html=$(COVERAGEDIR)/example.coverprofile -o $(COVERAGEDIR)/example.html
go tool cover -html=coverage.out -o coverage.html

tc: test cover
coveralls:
if [ ! -d $(COVERAGEDIR) ]; then mkdir $(COVERAGEDIR); fi
gover $(COVERAGEDIR) $(COVERAGEDIR)/coveralls.coverprofile
goveralls -coverprofile=$(COVERAGEDIR)/coveralls.coverprofile -service=$(SERVICE) -repotoken=$(COVERALLS_TOKEN)
goveralls -coverprofile=coverage.out -service=$(SERVICE) -repotoken=$(COVERALLS_TOKEN)

clean:
go clean
Expand All @@ -61,4 +54,4 @@ phony: clean tc build

.PHONY: example
example:
go generate ./example
go generate ./example
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ An enum generator for go
The goal of go-enum is to create an easy to use enum generator that will take a decorated type declaration like `type EnumName int` and create the associated constant values and funcs that will make life a little easier for adding new values.
It's not perfect, but I think it's useful.

I took the output of the [Stringer](golang.org/x/tools/cmd/stringer) command as the `String()` method, and added a way to parse a string value.
I took the output of the [Stringer](https://godoc.org/golang.org/x/tools/cmd/stringer) command as the `String()` method, and added a way to parse a string value.

## Command options

Expand Down Expand Up @@ -68,7 +68,7 @@ const (
```

#### Example
There are a few examples in the `example` [directory](repo/blob/master/example).
There are a few examples in the `example` [directory](example).
I've included one here for easy access, but can't guarantee it's up to date.

``` go
Expand Down
2 changes: 1 addition & 1 deletion generator/assets/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c5b07cc

Please sign in to comment.