Hello, need some help. I'm not familar with go, sorry for my question.
package main
import (
"log"
"os"
"os/signal"
"regexp"
"strconv"
"sync"
"syscall"
"time"
"github.com/pkg/errors"
"github.com/spf13/viper"
tb "gopkg.in/tucnak/telebot.v2"
"golang.org/x/net/proxy"
)
func main() {
token, e := getToken(tgtoken)
if e != nil {
log.Fatalln(e)
}
log.Printf("Telegram Bot Token [%v] successfully obtained from env variable $TGTOKEN\n", token)
dialer, err := proxy.SOCKS5("tcp", "host:port", &proxy.Auth{User: "anon", Password:"anon"}, proxy.Direct)
if err != nil {
t.Fatal("Error creating dialer, aborting.")
}
// setup a http client
httpTransport := &http.Transport{}
httpClient := &http.Client{Transport: httpTransport}
httpTransport.Dial = dialer.Dial
var err error
bot, err = tb.NewBot(tb.Settings{
Token: token,
Poller: &tb.LongPoller{Timeout: 10 * time.Second},
Client: httpClient
})
root@honda:/var/www/tg-captcha-bot# docker-compose build
Building tg-captcha-bot
Step 1/12 : FROM golang:1.13.4-alpine3.10 as builder
---> 3024b4e742b0
Step 2/12 : ENV GO111MODULE=on
---> Using cache
---> e032ddee3b2b
Step 3/12 : WORKDIR /go/src/github.com/mxssl/tg-captcha-bot
---> Using cache
---> c2d3321ebe20
Step 4/12 : COPY . .
---> Using cache
---> 674d3ed6621e
Step 5/12 : RUN apk add --no-cache ca-certificates curl git
---> Running in 7600296a5c01
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/6) Installing nghttp2-libs (1.39.2-r0)
(2/6) Installing libcurl (7.66.0-r0)
(3/6) Installing curl (7.66.0-r0)
(4/6) Installing expat (2.2.8-r0)
(5/6) Installing pcre2 (10.33-r0)
(6/6) Installing git (2.22.2-r0)
Executing busybox-1.30.1-r2.trigger
OK: 21 MiB in 21 packages
Removing intermediate container 7600296a5c01
---> 2ad7a165cbc9
Step 6/12 : RUN CGO_ENABLED=0 GOOS=`go env GOHOSTOS` GOARCH=`go env GOHOSTARCH` go build -v -mod=vendor -o bot
---> Running in b3b9270cd7bc
build github.com/mxssl/tg-captcha-bot: cannot load golang.org/x/net/proxy: open /go/src/github.com/mxssl/tg-captcha-bot/vendor/golang.org/x/net/proxy: no such file or directory
ERROR: Service 'tg-captcha-bot' failed to build: The command '/bin/sh -c CGO_ENABLED=0 GOOS=`go env GOHOSTOS` GOARCH=`go env GOHOSTARCH` go build -v -mod=vendor -o bot' returned a non-zero code: 1