Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Commit

Permalink
generate script and test
Browse files Browse the repository at this point in the history
  • Loading branch information
kazegusuri committed Sep 10, 2018
1 parent c487dba commit 5346f65
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions .circleci/config.yml
Expand Up @@ -26,6 +26,7 @@ jobs:
working_directory: server
command: |
./setup.sh
./generate.sh
./test.sh -v
- run:
name: build
Expand Down
14 changes: 14 additions & 0 deletions server/generate.sh
@@ -0,0 +1,14 @@
#!/bin/bash -eu

cd `dirname $0`

PACKAGE_NAME=github.com/mercari/mtc2018-web/server

targets=`find . -type f \( -name '*.go' -and -not -iwholename '*vendor*' -and -not -iwholename '*node_modules*' \)`
packages=`go list ${PACKAGE_NAME}/...`

set -x

# Apply tools
export PATH=$(pwd)/bin:$PATH
GO111MODULE=off go generate $packages
4 changes: 3 additions & 1 deletion server/test.sh
Expand Up @@ -9,9 +9,11 @@ packages=`go list ${PACKAGE_NAME}/...`

# Apply tools
export PATH=$(pwd)/bin:$PATH
GO111MODULE=off go generate $packages
goimports -w $targets
go tool vet $targets
golint -min_confidence 0.6 -set_exit_status $packages

go test -race ./... $@

# diff check
git diff --quiet

0 comments on commit 5346f65

Please sign in to comment.