Skip to content

Commit

Permalink
fix VScode warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jreisinger committed Sep 3, 2022
1 parent be4afbc commit 9449bbb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
3 changes: 1 addition & 2 deletions check/blocklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@ var getBlockListFile = func() (*os.File, error) {
return nil, newCheckError(err)
}

f, err := os.Open(file)
return f, nil
return os.Open(file)
}
2 changes: 1 addition & 1 deletion check/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestNonEmpty(t *testing.T) {
}
for _, test := range tests {
if got := nonEmpty(test.strings...); !equal(got, test.want) {

t.Errorf("nonEmpty(%v) = %v, want %v", test.strings, got, test.want)
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions check/firehol.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import (
"github.com/jreisinger/checkip"
)

type firehol struct {
blacklisted bool
}

// Firehol checks whether the ipaddr is found on blacklist
// https://iplists.firehol.org/?ipset=firehol_level1.
func Firehol(ipaddr net.IP) (checkip.Result, error) {
Expand Down
4 changes: 2 additions & 2 deletions check/testhelpers.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package check

import (
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"testing"

Expand All @@ -12,7 +12,7 @@ import (

// loadResponse loads named file form testdata directory.
func loadResponse(t *testing.T, name string) []byte {
b, err := ioutil.ReadFile(filepath.Join("testdata", name))
b, err := os.ReadFile(filepath.Join("testdata", name))
require.NoError(t, err)
return b
}
Expand Down
7 changes: 1 addition & 6 deletions check/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,13 @@ func oldTlsVersion(tlsVersion uint16) bool {
}

func expiredCert(expiryDate time.Time) bool {
if expiryDate.Before(time.Now()) {
return true
}
return false
return expiryDate.Before(time.Now())
}

func tlsFormat(tlsVersion uint16) string {
switch tlsVersion {
case 0:
return ""
case tls.VersionSSL30:
return "SSLv3"
case tls.VersionTLS10:
return "TLS 1.0"
case tls.VersionTLS11:
Expand Down

0 comments on commit 9449bbb

Please sign in to comment.