Skip to content

Commit

Permalink
Linter fixes and test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Aug 7, 2024
1 parent 9906ef7 commit 96aabd7
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion brfc_definintions.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package paymail
const (
BRFCBasicAddressResolution = "759684b1a19a" // more info: http://bsvalias.org/04-01-basic-address-resolution.html
BRFCP2PPaymentDestination = "2a40af698840" // more info: https://docs.moneybutton.com/docs/paymail/paymail-07-p2p-payment-destination.html
BRFCP2PPaymentDestinationWithToken = "f792b6eff07a" // more info: https://docs.moneybutton.com/docs/paymail/paymail-11-p2p-payment-destination-tokens.html
BRFCP2PPaymentDestinationWithToken = "f792b6eff07a" //nolint:gosec // more info: https://docs.moneybutton.com/docs/paymail/paymail-11-p2p-payment-destination-tokens.html
BRFCP2PTransactions = "5f1323cddf31" // more info: https://docs.moneybutton.com/docs/paymail/paymail-06-p2p-transactions.html
BRFCPaymentDestination = "paymentDestination" // more info: http://bsvalias.org/04-01-basic-address-resolution.html
BRFCPayToProtocolPrefix = "7bd25e5a1fc6" // more info: http://bsvalias.org/04-04-payto-protocol-prefix.html
Expand Down
2 changes: 1 addition & 1 deletion capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (c *Client) GetCapabilities(target string, port int) (response *Capabilitie

// Set the base url and path
// https://<host-discovery-target>:<host-discovery-port>/.well-known/bsvalias[network]
reqURL := fmt.Sprintf("https://%s:%d/.well-known/%s%s", target, port, DefaultServiceName, c.options.network.URLSuffix())
reqURL := fmt.Sprintf("https://%s:%d/.well-known/%s%s", target, port, DefaultServiceName, c.options.network.URLSuffix()) //nolint:nosprintfhostport // no need to check

// Fire the GET request
var resp StandardResponse
Expand Down
1 change: 0 additions & 1 deletion dns_sec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func TestClient_CheckDNSSEC(t *testing.T) {
{"moneybutton", true},
{"asdfadfasdfasdfasdf10909.com", true},
{"google.com", false},
{"moneybutton.com", false},
// {"relayx.io", false}, // Disabled for timeout issues
{"cloudflare.com", false},
{"mrz1836.com", false},
Expand Down
2 changes: 1 addition & 1 deletion examples/client/check_ssl/check_ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func main() {

// Check the SSL certificate
var valid bool
if valid, err = client.CheckSSL("moneybutton.com"); err != nil {
if valid, err = client.CheckSSL("handcash.io"); err != nil {
log.Fatal("error getting SSL certificate: " + err.Error())
} else if !valid {
log.Fatal("SSL certificate validation failed")
Expand Down
2 changes: 1 addition & 1 deletion server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestCreateServer(t *testing.T) {
}
s := CreateServer(config)
require.NotNil(t, s)
assert.IsType(t, &http.Server{}, s)
assert.IsType(t, &http.Server{}, s) //nolint:gosec // no need to check for unhandled errors
assert.Equal(t, fmt.Sprintf(":%d", config.Port), s.Addr)
assert.Equal(t, config.Timeout, s.WriteTimeout)
assert.Equal(t, config.Timeout, s.ReadTimeout)
Expand Down
4 changes: 2 additions & 2 deletions srv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestClient_GetSRVRecord(t *testing.T) {
10,
10,
},
{
/*{
"valid - moneybutton",
DefaultServiceName,
DefaultProtocol,
Expand All @@ -57,7 +57,7 @@ func TestClient_GetSRVRecord(t *testing.T) {
443,
10,
10,
},
},*/
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (c *Client) CheckSSL(host string) (valid bool, err error) {
&dialer,
DefaultProtocol,
fmt.Sprintf("[%s]:%d", ip.String(), DefaultPort),
&tls.Config{
&tls.Config{ //nolint:gosec // no need to check for unhandled errors
ServerName: host,
},
)
Expand Down

0 comments on commit 96aabd7

Please sign in to comment.