Updated to Go 1.18, removed debug log, added Go Version to --version output

This commit is contained in:
Marc Ole Bulling
2022-03-16 10:56:46 +01:00
parent 68dd846f14
commit 7f9037ff1f
34 changed files with 15 additions and 68 deletions

View File

@@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.17'
go-version: '^1.18'
- run: go generate ./...
- run: go test ./... -parallel 8 --tags=test,awsmock
- run: go clean -testcache

View File

@@ -1,4 +1,4 @@
FROM golang:1.17 AS build_base
FROM golang:1.18 AS build_base
## Usage:
## docker build . -t gokapi

View File

@@ -1,4 +1,4 @@
FROM golang:1.17
FROM golang:1.18
## To compile:
## cd Gokapi/build/

View File

@@ -1,6 +1,6 @@
module github.com/forceu/gokapi
go 1.17
go 1.18
require (
git.mills.io/prologic/bitcask v1.0.2

View File

@@ -23,15 +23,16 @@ import (
"math/rand"
"os"
"os/signal"
"runtime/debug"
"syscall"
"time"
)
// Version is the current version in readable form.
// The go generate call below needs to be modified as well
const Version = "1.5.1"
const Version = "1.5.2"
//go:generate sh "../../build/setVersionTemplate.sh" "1.5.1"
//go:generate sh "../../build/setVersionTemplate.sh" "1.5.2"
//go:generate sh -c "cp \"$(go env GOROOT)/misc/wasm/wasm_exec.js\" ../../internal/webserver/web/static/js/ && echo Copied wasm_exec.js"
//go:generate sh -c "GOOS=js GOARCH=wasm go build -o ../../internal/webserver/web/main.wasm github.com/forceu/gokapi/cmd/wasmdownloader && echo Compiled WASM module"
@@ -74,6 +75,12 @@ func showVersion(passedFlags flags) {
fmt.Println("Builder: " + environment.Builder)
fmt.Println("Build Date: " + environment.BuildTime)
fmt.Println("Docker Version: " + environment.IsDocker)
info, ok := debug.ReadBuildInfo()
if ok {
fmt.Println("Go Version: " + info.GoVersion)
} else {
fmt.Println("Go Version: unknown")
}
osExit(0)
}
}

View File

@@ -1,5 +1,4 @@
//go:build !integration && test
// +build !integration,test
package main

View File

@@ -1,5 +1,4 @@
//go:build js && wasm
// +build js,wasm
package main

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/forceu/gokapi
go 1.17
go 1.18
require (
git.mills.io/prologic/bitcask v1.0.2

1
go.sum
View File

@@ -516,7 +516,6 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package configuration
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package cloudconfig
import (

View File

@@ -341,9 +341,6 @@ func parseServerSettings(result *models.Configuration, formObjects *[]jsonFormOb
return err
}
result.PicturesAlwaysLocal = picturesAlwaysLocal == "local"
fmt.Println(picturesAlwaysLocal)
fmt.Println(result.PicturesAlwaysLocal)
return nil
}

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package environment
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package helper
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package helper
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package logging
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package models
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package models
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package storage
import (

View File

@@ -1,5 +1,4 @@
//go:build !noaws && !awsmock
// +build !noaws,!awsmock
package aws

View File

@@ -1,5 +1,4 @@
//go:build !noaws && awsmock
// +build !noaws,awsmock
package aws

View File

@@ -1,5 +1,4 @@
//go:build noaws
// +build noaws
package aws

View File

@@ -1,5 +1,4 @@
//go:build awstest && !awsmock && test
// +build awstest,!awsmock,test
package aws

View File

@@ -1,5 +1,4 @@
//go:build test
// +build test
package test

View File

@@ -1,5 +1,4 @@
//go:build test
// +build test
package test

View File

@@ -1,5 +1,4 @@
//go:build test
// +build test
package testconfiguration

View File

@@ -1,5 +1,4 @@
//go:build test
// +build test
package testconfiguration

View File

@@ -1,5 +1,4 @@
//go:build !integration && test
// +build !integration,test
package webserver
@@ -18,9 +17,6 @@ import (
"time"
)
// Please note that if this test is run with go test -race, it will fail as there is a bug in html/template that
// causes data race. It will be fixed in Go 1.17, see https://github.com/golang/go/issues/39807
func TestMain(m *testing.M) {
testconfiguration.Create(true)
configuration.Load()

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package api
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package sessionmanager
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package downloadstatus
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package fileupload
import (

View File

@@ -1,6 +1,3 @@
//go:build test
// +build test
package ssl
import (

View File

@@ -1,2 +1,2 @@
{{define "app_name"}}Gokapi{{end}}
{{define "version"}}1.5.1{{end}}
{{define "version"}}1.5.2{{end}}