1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

format code

This commit is contained in:
Timothy 2017-08-17 10:36:58 +08:00
parent f9bd43d299
commit e421c27afc
2 changed files with 12 additions and 11 deletions

View File

@ -9,8 +9,9 @@ import (
"net/url" "net/url"
"strconv" "strconv"
"strings" "strings"
"golang.org/x/net/proxy"
"github.com/bitly/go-simplejson" "github.com/bitly/go-simplejson"
"golang.org/x/net/proxy"
) )
func getCurrentIP(url string) (string, error) { func getCurrentIP(url string) (string, error) {
@ -193,7 +194,7 @@ func postData(url string, content url.Values) (string, error) {
} }
values := generateHeader(content) values := generateHeader(content)
req, _ := http.NewRequest("POST", "https://dnsapi.cn" + url, strings.NewReader(values.Encode())) req, _ := http.NewRequest("POST", "https://dnsapi.cn"+url, strings.NewReader(values.Encode()))
req.Header.Set("Content-Type", "application/x-www-form-urlencoded") req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req.Header.Set("User-Agent", fmt.Sprintf("GoDNS/0.1 (%s)", configuration.Email)) req.Header.Set("User-Agent", fmt.Sprintf("GoDNS/0.1 (%s)", configuration.Email))