Skip to content

Commit

Permalink
Re org directory to match Go best practice
Browse files Browse the repository at this point in the history
Move main.go to cmd.stupid
Move infra under pkg
Update readme accordingly
Update gitignore to allow cmd/stupid dir

Remove sample chaincodes

Signed-off-by: Jay Guo <guojiannan1101@gmail.com>
  • Loading branch information
guoger committed Nov 6, 2020
1 parent 18c1e00 commit b4d66f6
Show file tree
Hide file tree
Showing 17 changed files with 10 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*.dll
*.so
*.dylib
stupid
./stupid

# Test binary, build with `go test -c`
*.test
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Go1.11 or higher. Go1.13 is recommended.

You need to build from source for now (Docker image on the way).

Clone this repo and run `go build` at root dir. This is a go module project so you don't need to clone it into `GOPATH`. It will download required dependencies automatically, which may take a while depending on network connection. Once it finishes building, you should have a executable named `stupid`.
Clone this repo and run `go build ./cmd/stupid` at root dir. This is a go module project so you don't need to clone it into `GOPATH`. It will download required dependencies automatically, which may take a while depending on network connection. Once it finishes building, you should have a executable named `stupid`.

### Configure

Expand Down
5 changes: 3 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ jobs:
- task: Go@0
inputs:
command: 'get'
arguments: '-d'
arguments: '-d ./...'
workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: Go@0
inputs:
command: 'build'
arguments: './...'
workingDirectory: '$(System.DefaultWorkingDirectory)'

- job:
Expand All @@ -35,7 +36,7 @@ jobs:
- task: Go@0
inputs:
command: 'get'
arguments: '-d'
arguments: '-d ./...'
workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: Go@0
inputs:
Expand Down
5 changes: 0 additions & 5 deletions chaincodes/go.mod

This file was deleted.

44 changes: 0 additions & 44 deletions chaincodes/putget.go

This file was deleted.

2 changes: 1 addition & 1 deletion main.go → cmd/stupid/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"
"time"

"github.com/guoger/stupid/infra"
"github.com/guoger/stupid/pkg/infra"
log "github.com/sirupsen/logrus"
)

Expand Down
4 changes: 2 additions & 2 deletions integration-test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -ex

DIR=$PWD

Expand All @@ -8,7 +8,7 @@ cd ./fabric-samples/test-network
echo y | ./network.sh up createChannel
echo y | ./network.sh deployCC
cp -r organizations "$DIR" && cd "$DIR"
go build
go build ./cmd/stupid
STUPID_LOGLEVEL=debug ./stupid config.yaml 100


File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions infra/config_test.go → pkg/infra/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"io/ioutil"
"os"

"github.com/guoger/stupid/pkg/infra"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/guoger/stupid/infra"
)

var _ = Describe("Config", func() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion infra/proposer_test.go → pkg/infra/proposer_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package infra_test

import (
"github.com/guoger/stupid/infra"
"github.com/guoger/stupid/pkg/infra"
"github.com/hyperledger/fabric-sdk-go/pkg/fab/mocks"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down

0 comments on commit b4d66f6

Please sign in to comment.