Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-miracl committed Feb 22, 2018
1 parent 92eda8b commit 3accbaf
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 42 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ script:
- test -z "$(gofmt -s -l . 2>&1 | grep -v vendor | tee /dev/stderr)"
- golint -set_exit_status ./...
- ineffassign ./
- megacheck -simple.exit-non-zero -unused.exit-non-zero ./
- megacheck -simple.exit-non-zero=true -staticcheck.exit-non-zero=true -unused.exit-non-zero=true ./
- megacheck -tests=false -simple.enabled=false -staticcheck.enabled=false -unused.exit-non-zero=true ./
- go test -coverprofile .coverprofile
- $GOPATH/bin/goveralls -v -coverprofile .coverprofile -service=travis-ci

4 changes: 0 additions & 4 deletions loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ func containsURL(searchURL *pkgurl.URL, urls []pkgurl.URL) bool {
return false
}

func newClient() http.Client {
return http.Client{Transport: newTransport()}
}

func newTransport() *http.Transport {
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
Expand Down
8 changes: 0 additions & 8 deletions loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ func TestLoadURL_Relative(t *testing.T) {

// --------

func TestNewClient(t *testing.T) {
c := newClient()
assert.NotNil(t, c)
assert.NotNil(t, c.Transport)
}

// --------

func TestLoadURLsRecursive_LoadError(t *testing.T) {
data, err := loadURLsRecursive(nil, url.URL{})
assert.NotNil(t, err)
Expand Down
9 changes: 0 additions & 9 deletions merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ import (
"reflect"
)

func mergeAll(fromData ...interface{}) (interface{}, error) {
var toData interface{}
err := mergeTo(&toData, fromData...)
if err != nil {
return nil, err
}
return toData, nil
}

func mergeTo(toData interface{}, fromData ...interface{}) error {
for _, fromDatum := range fromData {
err := merge(toData, fromDatum)
Expand Down
20 changes: 0 additions & 20 deletions merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,6 @@ import (
"testing"
)

func TestMergeAll(t *testing.T) {
data1 := map[string]interface{}{"x": 1}
data2 := map[string]interface{}{"y": 1}
data, err := mergeAll(data1, data2)
assert.Nil(t, err)
assert.NotNil(t, data)
m := data.(map[string]interface{})
assert.NotNil(t, m)
assert.Contains(t, m, "x")
assert.Contains(t, m, "y")
}

func TestMergeAll_MergeToError(t *testing.T) {
data1 := map[string]interface{}{}
data2 := []interface{}{}
data, err := mergeAll(data1, data2)
assert.NotNil(t, err)
assert.Nil(t, data)
}

func TestMergeTo(t *testing.T) {
var toData interface{}
data1 := 1
Expand Down

0 comments on commit 3accbaf

Please sign in to comment.