Skip to content

Commit

Permalink
Merge pull request #71 from cloud-barista/hotfix-workflow
Browse files Browse the repository at this point in the history
Fix syntax and path issue of lint workflow
  • Loading branch information
hermitkim1 authored Jan 28, 2021
2 parents eb8fb9c + f299049 commit 36a8b5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/lint-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ name: lint-on-push

# This workflow is triggered on push
on:
push:
branches:
- '**'
paths-ignore:
on:
push:
# Ignoring branches
branches-ignore:
Expand Down Expand Up @@ -47,4 +42,4 @@ jobs:
run: go get github.com/golangci/golangci-lint/cmd/[email protected]

- name: Run golangci-lint
run: golangci-lint run
run: $(go env GOPATH)/bin/golangci-lint run
8 changes: 5 additions & 3 deletions poc-cb-net/archive/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import (
)

const (
// I use TUN interface, so only plain IP packet, no ethernet header + mtu is set to 1300
// BUFFERSIZE represents a size of read buffer.
BUFFERSIZE = 1500
// MTU represents a maximum transmission unit.
MTU = "1300"
)

Expand All @@ -29,11 +30,13 @@ func runIP(args ...string) {
}
}

// Tunneling represents thg information for tunneling.
type Tunneling struct {
RemoteIP string `json:"RemoteIP"`
Port int `json:"Port"`
}

// LoadConfig represents a function to read tunneling information from json file.
func LoadConfig() (Tunneling, error) {
var config Tunneling
file, err := os.Open("tunneling.json")
Expand All @@ -45,7 +48,6 @@ func LoadConfig() (Tunneling, error) {
}
}()


if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -113,7 +115,7 @@ func main() {
runIP("addr", "add", *localIP, "dev", iface.Name())
runIP("link", "set", "dev", iface.Name(), "up")

// reslove remote addr
// resolve remote addr
remoteAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%v", *remoteIP, *port))
if nil != err {
log.Fatalln("Unable to resolve remote addr:", err)
Expand Down

0 comments on commit 36a8b5f

Please sign in to comment.