Skip to content

Commit

Permalink
Fix mistype, use go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
donce committed Jan 25, 2018
1 parent f8b761a commit 738377e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/mysterium_monitor/command_run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package command_run

import (
"errors"
"github.com/mysterium/node/ip"
command_client "github.com/mysterium/node/cmd/mysterium_client/run"
"github.com/mysterium/node/ip"
"github.com/mysterium/node/openvpn"
"sync"
"time"
Expand Down
14 changes: 7 additions & 7 deletions ip/rest_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
)

const IpifyAPIURL = "https://api.ipify.org/"
const IpifiAPICLient = "goclient-v0.1"
const IpifiAPILogPrefix = "[ipify.api] "
const IpifyAPICLient = "goclient-v0.1"
const IpifyAPILogPrefix = "[ipify.api] "

func NewResolver() Resolver {
return NewResolverWithTimeout(60 * time.Second)
Expand All @@ -35,10 +35,10 @@ func (client *clientRest) GetPublicIP() (string, error) {
var ipResponse IPResponse

request, err := http.NewRequest("GET", IpifyAPIURL+"/?format=json", nil)
request.Header.Set("User-Agent", IpifiAPICLient)
request.Header.Set("User-Agent", IpifyAPICLient)
request.Header.Set("Accept", "application/json")
if err != nil {
log.Critical(IpifiAPILogPrefix, err)
log.Critical(IpifyAPILogPrefix, err)
return "", err
}

Expand All @@ -47,7 +47,7 @@ func (client *clientRest) GetPublicIP() (string, error) {
return "", err
}

log.Info(IpifiAPILogPrefix, "IP detected: ", ipResponse.IP)
log.Info(IpifyAPILogPrefix, "IP detected: ", ipResponse.IP)
return ipResponse.IP, nil
}

Expand All @@ -66,14 +66,14 @@ func (client *clientRest) GetOutboundIP() (string, error) {
func (client *clientRest) doRequest(request *http.Request, responseDto interface{}) error {
response, err := client.httpClient.Do(request)
if err != nil {
log.Error(IpifiAPILogPrefix, err)
log.Error(IpifyAPILogPrefix, err)
return err
}
defer response.Body.Close()

err = parseResponseError(response)
if err != nil {
log.Error(IpifiAPILogPrefix, err)
log.Error(IpifyAPILogPrefix, err)
return err
}

Expand Down

0 comments on commit 738377e

Please sign in to comment.