From 99f24043130d8b3c5cf098371e23c64abffef385 Mon Sep 17 00:00:00 2001 From: Robin Tarsiger Date: Thu, 31 Mar 2016 12:55:58 -0500 Subject: Run go fmt on recent changes --- proxies/proxy_socks5/proxy_socks5.go | 6 +++--- proxies/proxy_transparent/proxy_transparent.go | 22 ++++++++++---------- .../proxy_transparent_udp/proxy_transparent_udp.go | 24 +++++++++++----------- 3 files changed, 26 insertions(+), 26 deletions(-) (limited to 'proxies') diff --git a/proxies/proxy_socks5/proxy_socks5.go b/proxies/proxy_socks5/proxy_socks5.go index 8037d4d..a893645 100644 --- a/proxies/proxy_socks5/proxy_socks5.go +++ b/proxies/proxy_socks5/proxy_socks5.go @@ -30,8 +30,8 @@ package proxy_socks5 import ( - "io" "fmt" + "io" golog "log" "net" "net/url" @@ -41,9 +41,9 @@ import ( "git.torproject.org/pluggable-transports/goptlib.git" "github.com/OperatorFoundation/obfs4/common/log" + "github.com/OperatorFoundation/obfs4/common/pt_extras" "github.com/OperatorFoundation/obfs4/common/socks5" "github.com/OperatorFoundation/obfs4/common/termmon" - "github.com/OperatorFoundation/obfs4/common/pt_extras" "github.com/OperatorFoundation/obfs4/transports" "github.com/OperatorFoundation/obfs4/transports/base" ) @@ -154,7 +154,7 @@ func clientHandler(termMon *termmon.TermMonitor, f base.ClientFactory, conn net. dialFn = dialer.Dial } - fmt.Println("Got dialer", dialFn, proxyURI, proxy.Direct) + fmt.Println("Got dialer", dialFn, proxyURI, proxy.Direct) remote, err := f.Dial("tcp", socksReq.Target, dialFn, args) if err != nil { diff --git a/proxies/proxy_transparent/proxy_transparent.go b/proxies/proxy_transparent/proxy_transparent.go index 4e9e22a..1f93a46 100644 --- a/proxies/proxy_transparent/proxy_transparent.go +++ b/proxies/proxy_transparent/proxy_transparent.go @@ -30,14 +30,14 @@ package proxy_transparent import ( - "io" "fmt" + "io" golog "log" "net" "net/url" - "sync" - "strings" "strconv" + "strings" + "sync" "golang.org/x/net/proxy" @@ -112,11 +112,11 @@ func clientHandler(target string, termMon *termmon.TermMonitor, f base.ClientFac termMon.OnHandlerStart() defer termMon.OnHandlerFinish() - fmt.Println("handling...") + fmt.Println("handling...") name := f.Transport().Name() - fmt.Println("Transport is", name) + fmt.Println("Transport is", name) // Deal with arguments. args, err := f.ParseArgs(&pt.Args{}) @@ -152,7 +152,7 @@ func clientHandler(target string, termMon *termmon.TermMonitor, f base.ClientFac } defer remote.Close() - fmt.Println("copying...") + fmt.Println("copying...") if err = copyLoop(conn, remote); err != nil { log.Warnf("%s(%s) - closed connection: %s", name, target, log.ElideError(err)) @@ -160,7 +160,7 @@ func clientHandler(target string, termMon *termmon.TermMonitor, f base.ClientFac log.Infof("%s(%s) - closed connection", name, target) } - fmt.Println("done") + fmt.Println("done") return } @@ -171,9 +171,9 @@ func ServerSetup(termMon *termmon.TermMonitor, bindaddrString string) (launched golog.Fatal(err) } - fmt.Println("ServerSetup") + fmt.Println("ServerSetup") - bindaddrs, _ := getServerBindaddrs(bindaddrString) + bindaddrs, _ := getServerBindaddrs(bindaddrString) for _, bindaddr := range bindaddrs { name := bindaddr.MethodName @@ -208,7 +208,7 @@ func ServerSetup(termMon *termmon.TermMonitor, bindaddrString string) (launched } func getServerBindaddrs(serverBindaddr string) ([]pt.Bindaddr, error) { - var result []pt.Bindaddr; + var result []pt.Bindaddr for _, spec := range strings.Split(serverBindaddr, ",") { var bindaddr pt.Bindaddr @@ -225,7 +225,7 @@ func getServerBindaddrs(serverBindaddr string) ([]pt.Bindaddr, error) { return nil, nil } bindaddr.Addr = addr -// bindaddr.Options = optionsMap[bindaddr.MethodName] + // bindaddr.Options = optionsMap[bindaddr.MethodName] result = append(result, bindaddr) } diff --git a/proxies/proxy_transparent_udp/proxy_transparent_udp.go b/proxies/proxy_transparent_udp/proxy_transparent_udp.go index 14f132f..7e4d118 100644 --- a/proxies/proxy_transparent_udp/proxy_transparent_udp.go +++ b/proxies/proxy_transparent_udp/proxy_transparent_udp.go @@ -30,14 +30,14 @@ package proxy_transparent_udp import ( - "io" "fmt" + "io" golog "log" "net" "net/url" - "sync" - "strings" "strconv" + "strings" + "sync" "golang.org/x/net/proxy" @@ -74,7 +74,7 @@ func ClientSetup(termMon *termmon.TermMonitor, target string) bool { continue } - udpAddr, err := net.ResolveUDPAddr("udp", socksAddr) + udpAddr, err := net.ResolveUDPAddr("udp", socksAddr) if err != nil { fmt.Println("Error resolving address", socksAddr) } @@ -99,11 +99,11 @@ func clientHandler(target string, termMon *termmon.TermMonitor, f base.ClientFac termMon.OnHandlerStart() defer termMon.OnHandlerFinish() - fmt.Println("handling...") + fmt.Println("handling...") name := f.Transport().Name() - fmt.Println("Transport is", name) + fmt.Println("Transport is", name) // Deal with arguments. args, err := f.ParseArgs(&pt.Args{}) @@ -139,7 +139,7 @@ func clientHandler(target string, termMon *termmon.TermMonitor, f base.ClientFac } defer remote.Close() - fmt.Println("copying...") + fmt.Println("copying...") if err = copyLoopUDP(conn, remote); err != nil { log.Warnf("%s(%s) - closed connection: %s", name, target, log.ElideError(err)) @@ -147,7 +147,7 @@ func clientHandler(target string, termMon *termmon.TermMonitor, f base.ClientFac log.Infof("%s(%s) - closed connection", name, target) } - fmt.Println("done") + fmt.Println("done") return } @@ -158,9 +158,9 @@ func ServerSetup(termMon *termmon.TermMonitor, bindaddrString string) bool { golog.Fatal(err) } - fmt.Println("ServerSetup") + fmt.Println("ServerSetup") - bindaddrs, _ := getServerBindaddrs(bindaddrString) + bindaddrs, _ := getServerBindaddrs(bindaddrString) for _, bindaddr := range bindaddrs { name := bindaddr.MethodName @@ -192,7 +192,7 @@ func ServerSetup(termMon *termmon.TermMonitor, bindaddrString string) bool { } func getServerBindaddrs(serverBindaddr string) ([]pt.Bindaddr, error) { - var result []pt.Bindaddr; + var result []pt.Bindaddr for _, spec := range strings.Split(serverBindaddr, ",") { var bindaddr pt.Bindaddr @@ -209,7 +209,7 @@ func getServerBindaddrs(serverBindaddr string) ([]pt.Bindaddr, error) { return nil, nil } bindaddr.Addr = addr -// bindaddr.Options = optionsMap[bindaddr.MethodName] + // bindaddr.Options = optionsMap[bindaddr.MethodName] result = append(result, bindaddr) } -- cgit v1.2.3