Last active
February 23, 2018 21:38
-
-
Save artyom/3f73ca859f7476902ba4e1c78da0429d to your computer and use it in GitHub Desktop.
Illustration that vgo does not (as of 2018-02-23) import "source" attribute from dep metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "me/example" | |
require ( | |
"github.com/armon/go-socks5" v0.0.0-20160902184237-e75332964ef5 | |
"golang.org/x/net" v0.0.0-20180218175443-cbe0f9307d01 | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. | |
[[projects]] | |
branch = "master" | |
name = "github.com/armon/go-socks5" | |
packages = ["."] | |
revision = "5ab49e6379c2e1ea5f402e29430ac01f39e60acc" | |
source = "github.com/artyom/go-socks5" | |
[solve-meta] | |
analyzer-name = "dep" | |
analyzer-version = 1 | |
inputs-digest = "48ec66c27c4be1d5d849c7840b1c13c6d7a65c8827bc0567361e9f8da7407ecb" | |
solver-name = "gps-cdcl" | |
solver-version = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[constraint]] | |
branch = "master" | |
name = "github.com/armon/go-socks5" | |
source = "github.com/artyom/go-socks5" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
socks5 "github.com/armon/go-socks5" | |
) | |
func main() { | |
addr := "localhost:1080" | |
flag.StringVar(&addr, "addr", addr, "address to listen") | |
flag.Parse() | |
if err := run(addr); err != nil { | |
fmt.Fprintln(os.Stderr, err) | |
os.Exit(1) | |
} | |
} | |
func run(addr string) error { | |
if addr == "" { | |
return fmt.Errorf("addr must not be empty") | |
} | |
server, err := socks5.New(&socks5.Config{}) | |
if err != nil { | |
return err | |
} | |
return server.ListenAndServe("tcp", addr) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment