From 994cdf8f4c66b95b9d22417ba2793b19af396b0f Mon Sep 17 00:00:00 2001 From: leech001 Date: Sun, 2 Apr 2023 09:18:45 +0300 Subject: [PATCH] Change go version to 1.20 Change update time to uint32 size --- .github/workflows/go_build.yml | 8 ++++---- Dockerfile | 2 +- app/go.mod | 2 +- app/main.go | 2 +- app/nmapScan.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go_build.yml b/.github/workflows/go_build.yml index a7facc5..c550765 100644 --- a/.github/workflows/go_build.yml +++ b/.github/workflows/go_build.yml @@ -14,16 +14,16 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: ^1.19 + go-version: ^1.20 - name: Build amd64 - run: cd app && go get main && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o monitor-amd64 + run: cd app && go get main && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-s -w -extldflags "-static"' -o monitor-amd64 - name: Build arm - run: cd app && go get main && CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o monitor-arm + run: cd app && go get main && CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -a -tags netgo -ldflags '-s -w -extldflags "-static"' -o monitor-arm - name: Build arm64 - run: cd app && go get main && CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o monitor-arm64 + run: cd app && go get main && CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -tags netgo -ldflags '-s -w -extldflags "-static"' -o monitor-arm64 - name: Build release uses: "marvinpinto/action-automatic-releases@latest" diff --git a/Dockerfile b/Dockerfile index 70f0524..c538533 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM golang:latest AS builder WORKDIR /build COPY app . RUN go get main -RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o monitor +RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static"' -o monitor FROM alpine:latest diff --git a/app/go.mod b/app/go.mod index 3be0176..6ab181b 100644 --- a/app/go.mod +++ b/app/go.mod @@ -1,6 +1,6 @@ module main -go 1.19 +go 1.20 require ( github.com/Ullaakut/nmap/v2 v2.2.2 diff --git a/app/main.go b/app/main.go index 56903c7..cd3fddf 100644 --- a/app/main.go +++ b/app/main.go @@ -12,7 +12,7 @@ import ( type Config struct { App struct { - Update uint16 + Update uint32 } Telegram struct { Token string diff --git a/app/nmapScan.go b/app/nmapScan.go index 22d195a..705b40b 100644 --- a/app/nmapScan.go +++ b/app/nmapScan.go @@ -10,7 +10,7 @@ import ( ) // Scanning hosts for open ports -func nmapScan(update uint16, bot *tgbotapi.BotAPI, group int64, hosts struct { +func nmapScan(update uint32, bot *tgbotapi.BotAPI, group int64, hosts struct { Host string Ports []string Exclusion struct {