Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
update deps and toolset
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Aug 28, 2019
1 parent 2bc0919 commit 4b23e2c
Show file tree
Hide file tree
Showing 170 changed files with 21,505 additions and 4,564 deletions.
56 changes: 36 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,60 +1,76 @@
SHELL = /bin/bash -euo pipefail
PKGS = $(shell go list ./... | grep -v vendor)
BIN = $(shell basename $(shell go list -m))
BINPATH = $(PWD)/bin
COMMIT = $(shell git rev-parse --verify HEAD)
DATE = $(shell date +%Y-%m-%dT%T%Z)
GO111MODULE = on
GOFLAGS = -mod=vendor
MODULE = $(shell go list -m)
PACKAGES = $(shell go list ./...)
PATHS = $(shell go list ./... | sed -e "s|$(shell go list -m)/\{0,1\}||g")
SHELL = /bin/bash -euo pipefail
TIMEOUT = 1s
BIN = $(shell basename $(shell pwd))

export PATH := $(BINPATH):$(PATH)

.DEFAULT_GOAL = test-with-coverage

.PHONY: env
env:
@echo "BIN: $(BIN)"
@echo "BINPATH: $(BINPATH)"
@echo "COMMIT: $(COMMIT)"
@echo "DATE: $(DATE)"
@echo "GO111MODULE: $(GO111MODULE)"
@echo "GOFLAGS: $(GOFLAGS)"
@echo "MODULE: $(MODULE)"
@echo "PACKAGES: $(PACKAGES)"
@echo "PATH: $(PATH)"
@echo "PATHS: $(PATHS)"
@echo "SHELL: $(SHELL)"
@echo "TIMEOUT: $(TIMEOUT)"


.PHONY: deps
deps:
@go mod tidy && go mod vendor && go mod verify

.PHONY: update
update:
@go get -mod= -u


.PHONY: format
format:
@goimports -local $(dirname $(go list -m)) -ungroup -w .
@goimports -local $(dir $(shell go list -m)) -ungroup -w $(PATHS)

.PHONY: generate
generate:
@go generate $(PKGS)
@go generate $(PACKAGES)

.PHONY: update
update:
@go get -mod= -u

.PHONY: refresh
refresh: generate format
refresh: update deps generate format


.PHONY: test
test:
@go test -race -timeout $(TIMEOUT) $(PKGS)
@go test -race -timeout $(TIMEOUT) $(PACKAGES)

.PHONY: test-with-coverage
test-with-coverage:
@go test -cover -timeout $(TIMEOUT) $(PKGS) | column -t | sort -r
@go test -cover -timeout $(TIMEOUT) $(PACKAGES) | column -t | sort -r

.PHONY: test-with-coverage-profile
test-with-coverage-profile:
@go test -cover -covermode count -coverprofile c.out -timeout $(TIMEOUT) $(PKGS)
@go test -cover -covermode count -coverprofile c.out -timeout $(TIMEOUT) $(PACKAGES)

.PHONY: test-smoke
test-smoke:
@echo not implemented yet
@echo nothing to do


.PHONY: build
build:
@go build -o bin/$(BIN) .
@go build -o bin/$(BIN) -ldflags "-s -w -X main.commit=$(COMMIT) -X main.date=$(DATE)" .

.PHONY: dist
dist:
@godownloader .goreleaser.yml > .github/install.sh

.PHONY: install
install:
@go build -o $(GOPATH)/bin/$(BIN) .
9 changes: 6 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
module github.com/kamilsk/forward

require (
github.com/Netflix/go-expect v0.0.0-20180928190340-9d1f4485533b // indirect
github.com/Netflix/go-expect v0.0.0-20190729225929-0e00d9168667 // indirect
github.com/golang/mock v1.3.1
github.com/google/gops v0.3.6
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c // indirect
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
github.com/kr/pty v1.1.8 // indirect
github.com/mattn/go-colorable v0.1.2 // indirect
github.com/mattn/go-isatty v0.0.9 // indirect
github.com/pkg/errors v0.8.1
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.4.0
go.octolab.org/toolkit/cli v0.0.2
gopkg.in/AlecAivazis/survey.v1 v1.8.4
go.octolab.org/toolkit/cli v0.0.3
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 // indirect
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 // indirect
gopkg.in/AlecAivazis/survey.v1 v1.8.5
)
21 changes: 15 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
github.com/Netflix/go-expect v0.0.0-20180928190340-9d1f4485533b h1:sSQK05nvxs4UkgCJaxihteu+r+6ela3dNMm7NVmsS3c=
github.com/Netflix/go-expect v0.0.0-20180928190340-9d1f4485533b/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
github.com/Netflix/go-expect v0.0.0-20190729225929-0e00d9168667 h1:l2RCK7mjLhjfZRIcCXTVHI34l67IRtKASBjusViLzQ0=
github.com/Netflix/go-expect v0.0.0-20190729225929-0e00d9168667/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
github.com/StackExchange/wmi v0.0.0-20170410192909-ea383cf3ba6e/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
Expand Down Expand Up @@ -47,6 +47,8 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
Expand Down Expand Up @@ -77,24 +79,31 @@ github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6Ut
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
go.octolab.org v0.0.2 h1:xKu9Jj+cF5QIQsqecGb6XpznTwtikpglFM+ecSMhSFI=
go.octolab.org v0.0.2/go.mod h1:Q0WkflsryI+n2hHnlIFauuzmzEK1eCcY1+egQTDWi8I=
go.octolab.org/toolkit/cli v0.0.2 h1:GRS/gP5AZY3lkhcy+YueWoSWpZ6yExkS9K9BMz7lmZE=
go.octolab.org/toolkit/cli v0.0.2/go.mod h1:8HxKRT+1R/qvT0yFnOdNLzXQkzyYeCG+Mjc2uVx3zT4=
go.octolab.org/toolkit/cli v0.0.3 h1:5I414vBPtanfDJJV8i65VGgwWYAhTmpZXqo9qbwOcrM=
go.octolab.org/toolkit/cli v0.0.3/go.mod h1:8HxKRT+1R/qvT0yFnOdNLzXQkzyYeCG+Mjc2uVx3zT4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20171017063910-8dbc5d05d6ed/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180606202747-9527bec2660b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 h1:ng0gs1AKnRRuEMZoTLLlbOd+C17zUDepwGQBb/n+JVg=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
gopkg.in/AlecAivazis/survey.v1 v1.8.4 h1:10xXXN3wgIhPheb5NI58zFgZv32Ana7P3Tl4shW+0Qc=
gopkg.in/AlecAivazis/survey.v1 v1.8.4/go.mod h1:iBNOmqKz/NUbZx3bA+4hAGLRC7fSK7tgtVDT4tB22XA=
gopkg.in/AlecAivazis/survey.v1 v1.8.5 h1:QoEEmn/d5BbuPIL2qvXwzJdttFFhRQFkaq+tEKb7SMI=
gopkg.in/AlecAivazis/survey.v1 v1.8.5/go.mod h1:iBNOmqKz/NUbZx3bA+4hAGLRC7fSK7tgtVDT4tB22XA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ import (
"strings"
"time"

"github.com/kamilsk/forward/internal/kubernetes"
"github.com/spf13/cobra"
survey "gopkg.in/AlecAivazis/survey.v1"

"github.com/kamilsk/forward/internal/kubernetes"
)

const entrySeparator = "--"

// New returns new root command.
func New(kubectl kubernetes.Interface) *cobra.Command {
cmd := &cobra.Command{
Short: "forward",
Use: "forward",
Short: "extended `kubectl port-forward`",
Long: "extended `kubectl port-forward` - reliable multiple port forwarding.",
Run: func(cmd *cobra.Command, args []string) {
handle(kubectl, args)
scanner := bufio.NewScanner(os.Stdin)
Expand Down
3 changes: 2 additions & 1 deletion internal/kubernetes/api/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package client_test
import (
"testing"

. "github.com/kamilsk/forward/internal/kubernetes/api/client"
"github.com/stretchr/testify/assert"

. "github.com/kamilsk/forward/internal/kubernetes/api/client"
)

func TestNew(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions internal/kubernetes/api/provider_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
//go:generate echo $PWD - $GOPACKAGE - $GOFILE
//go:generate mockgen -package $GOPACKAGE -destination mock_contract_test.go github.com/kamilsk/forward/internal/kubernetes/api API
//go:generate echo generated at $PWD/$GOFILE ($GOPACKAGE)
package api_test

import (
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"

"github.com/kamilsk/forward/internal/kubernetes"
. "github.com/kamilsk/forward/internal/kubernetes/api"
"github.com/stretchr/testify/assert"
)

func TestProvider_Find(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion internal/kubernetes/cli/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"io/ioutil"
"testing"

. "github.com/kamilsk/forward/internal/kubernetes/cli/client"
"github.com/stretchr/testify/assert"

. "github.com/kamilsk/forward/internal/kubernetes/cli/client"
)

func TestClient_Run(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion internal/kubernetes/cli/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"io"
"strings"

"github.com/kamilsk/forward/internal/kubernetes"
"github.com/pkg/errors"

"github.com/kamilsk/forward/internal/kubernetes"
)

const kubectl = "kubectl"
Expand Down
7 changes: 4 additions & 3 deletions internal/kubernetes/cli/provider_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:generate echo $PWD - $GOPACKAGE - $GOFILE
//go:generate mockgen -package $GOPACKAGE -destination mock_contract_test.go github.com/kamilsk/forward/internal/kubernetes/cli CLI
//go:generate echo generated at $PWD/$GOFILE ($GOPACKAGE)
package cli_test

import (
Expand All @@ -10,10 +10,11 @@ import (
"testing"

"github.com/golang/mock/gomock"
"github.com/kamilsk/forward/internal/kubernetes"
. "github.com/kamilsk/forward/internal/kubernetes/cli"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"

"github.com/kamilsk/forward/internal/kubernetes"
. "github.com/kamilsk/forward/internal/kubernetes/cli"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/mattn/go-isatty/go.mod

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

4 changes: 2 additions & 2 deletions vendor/github.com/mattn/go-isatty/go.sum

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

2 changes: 0 additions & 2 deletions vendor/go.octolab.org/toolkit/cli/cobra/completion.go

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

5 changes: 1 addition & 4 deletions vendor/go.octolab.org/toolkit/cli/cobra/version.go

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

8 changes: 6 additions & 2 deletions vendor/golang.org/x/sys/unix/affinity_linux.go

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

54 changes: 54 additions & 0 deletions vendor/golang.org/x/sys/unix/asm_linux_riscv64.s

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

Loading

0 comments on commit 4b23e2c

Please sign in to comment.