Skip to content

Commit

Permalink
golang up version to 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
kmlebedev committed Aug 29, 2022
1 parent f6fe0a6 commit a656eae
Show file tree
Hide file tree
Showing 7 changed files with 309 additions and 135 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ compile: ## Compile the proto file.
.PHONY: server

server_build:
CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" GOOS=windows GOARCH=amd64 go build -race -ldflags "-extldflags -static -s -w" -o bin/server.exe main.go
CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" GOOS=windows GOARCH=amd64 go build -ldflags "-extldflags -static -s -w" -o bin/server.exe main.go

## Build and run server. brew install mingw-w64
server: server_build
mkdir -p logs
wine64 bin/server.exe

queues_build:
CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" GOOS=windows GOARCH=amd64 go build -race -ldflags "-extldflags -static -s -w" -o bin/queues.exe examples/queues/main.go
CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" GOOS=windows GOARCH=amd64 go build -ldflags "-extldflags -static -s -w" -o bin/queues.exe examples/queues/main.go

queues: queues_build
wine64 bin/queues.exe

.PHONY: client
client: ## Build and run client.
go build -race -ldflags "-s -w" -o bin/client examples/grpc-client/main.go
go build -ldflags "-s -w" -o bin/client examples/grpc-client/main.go
bin/client

.PHONY: tgbot
tgbot: ## Build and run telegram bot app.
go build -race -ldflags "-s -w" -o bin/tgbot examples/telegram-bot/main.go
go build -ldflags "-s -w" -o bin/tgbot examples/telegram-bot/main.go
bin/tgbot

build:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export TC_DLL_PATH=txmlconnector64-6.19.2.21.8.dll

```bash
make server
CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" GOOS=windows GOARCH=amd64 go build -race -ldflags "-s -w" -o bin/server.exe server/main.go
CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o bin/server.exe server/main.go
wine64 bin/server.exe
00ea:fixme:process:SetProcessPriorityBoost (FFFFFFFFFFFFFFFF,1): stub
time="2020-12-17T20:57:01+05:00" level=info msg="Initialize txmlconnector"
Expand Down Expand Up @@ -100,7 +100,7 @@ export TC_LOG_LEVEL="DEBUG"
#### Example output:
```bash
make client
go build -race -ldflags "-s -w" -o bin/client client/main.go
go build -ldflags "-s -w" -o bin/client client/main.go
bin/client
INFO[0000] Client running ...
INFO[0001] res <result success="true"/>
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.go_build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18 as builder
FROM golang:1.19-alpine as builder
ENV GOARCH=amd64

COPY ./main.go /go/src/github.com/kmlebedev/txmlconnector/main.go
Expand All @@ -13,7 +13,7 @@ WORKDIR /go/src/github.com/kmlebedev/txmlconnector

RUN apk add --no-cache --virtual build-dependencies --update mingw-w64-gcc gcc mingw-w64-gcc libc-dev musl-dev && \
go mod download && \
GOOS=windows CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" GOOS=windows GOARCH=amd64 go build -race -ldflags "-extldflags -static -s -w" -o /go/bin/server.exe main.go && \
GOOS=windows CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" GOOS=windows GOARCH=amd64 go build -ldflags "-extldflags -static -s -w" -o /go/bin/server.exe main.go && \
GOOS=linux CGO_ENABLED=0 go build -ldflags "-extldflags -static" -o /go/bin/client examples/grpc-client/main.go

FROM alpine AS final
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.go_build_ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18 as builder
FROM golang:1.19-alpine as builder
ENV GOARCH=amd64

COPY ./main.go /go/src/github.com/kmlebedev/txmlconnector/main.go
Expand All @@ -13,7 +13,7 @@ WORKDIR /go/src/github.com/kmlebedev/txmlconnector

RUN apk add --no-cache --virtual build-dependencies --update mingw-w64-gcc gcc libc-dev musl-dev && \
go mod download && \
GOOS=windows CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" GOOS=windows GOARCH=amd64 go build -race -ldflags "-extldflags -static -s -w" -o /go/bin/server.exe main.go && \
GOOS=windows CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" GOOS=windows GOARCH=amd64 go build -ldflags "-extldflags -static -s -w" -o /go/bin/server.exe main.go && \
GOOS=linux CGO_ENABLED=0 go build -ldflags "-extldflags -static" -o /go/bin/client examples/grpc-client/main.go

FROM ubuntu:22.04 AS final
Expand Down
6 changes: 3 additions & 3 deletions examples/clickhouse-exporter/financial/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ func main() {
loadAllInvestingData(conn)
}
if ticker == "Exports" || ticker == "ALL" {
//if err := crawExports(conn); err != nil {
// log.Error(err)
//}
if err := crawExports(conn); err != nil {
log.Error(err)
}
for code, _ := range exporter.CodeToId {
if err := exporter.LoadHistoricalData(conn, code, "07/07/2014", time.Now().Format("01/02/2006"), "Daily"); err != nil {
log.Error(err)
Expand Down
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kmlebedev/txmlconnector

go 1.18
go 1.19

require (
github.com/360EntSecGroup-Skylar/excelize/v2 v2.4.0
Expand All @@ -14,14 +14,13 @@ require (
github.com/shakinm/xlsReader v0.9.10
github.com/sirupsen/logrus v1.8.1
github.com/streadway/amqp v1.0.0
gocloud.dev v0.24.0
gocloud.dev/pubsub/rabbitpubsub v0.24.0
google.golang.org/grpc v1.40.0
google.golang.org/protobuf v1.27.1
gocloud.dev v0.26.0
gocloud.dev/pubsub/rabbitpubsub v0.26.0
google.golang.org/grpc v1.45.0
google.golang.org/protobuf v1.28.1
)

require (
cloud.google.com/go/pubsub v1.17.1 // indirect
github.com/andybalholm/cascadia v1.2.0 // indirect
github.com/antchfx/htmlquery v1.2.3 // indirect
github.com/antchfx/xmlquery v1.2.4 // indirect
Expand All @@ -30,24 +29,25 @@ require (
github.com/extrame/ole2 v0.0.0-20160812065207-d69429661ad7 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
github.com/googleapis/gax-go/v2 v2.2.0 // indirect
github.com/kennygrant/sanitize v1.2.4 // indirect
github.com/metakeule/fmtdate v1.1.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/rabbitmq/amqp091-go v1.3.4 // indirect
github.com/richardlehane/mscfb v1.0.3 // indirect
github.com/richardlehane/msoleps v1.0.1 // indirect
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
github.com/temoto/robotstxt v1.1.1 // indirect
github.com/xuri/efp v0.0.0-20210322160811-ab561f5b45e3 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/net v0.0.0-20210825183410-e898025ed96a // indirect
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect
golang.org/x/net v0.0.0-20220401154927-543a649e0bdd // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 // indirect
golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/api v0.58.0 // indirect
google.golang.org/api v0.74.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211019152133-63b7e35f4404 // indirect
google.golang.org/genproto v0.0.0-20220401170504-314d38edb7de // indirect
)
Loading

0 comments on commit a656eae

Please sign in to comment.