- 克隆此仓库:
git clone https://github.com/your-username/ssh-tunnel.git
cd ssh-tunnel
go mod tidy
- 编译:
# mac amd64
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ssh-tunnel-darwin -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-w -s" -v .
# mac arm64
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o ssh-tunnel-darwin -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-w -s" -v .
# linux amd64
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ssh-tunnel-linux -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-w -s" -v .
# linux arm64
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ssh-tunnel-arm64 -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-w -s" -v .
# windows amd64
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ssh-tunnel-windows -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-w -s" -v .
Copyright (c) 2023 许怀安