mirror of
https://github.com/Forceu/Gokapi.git
synced 2026-01-06 00:49:33 -06:00
Updated to Go 1.18, removed debug log, added Go Version to --version output
This commit is contained in:
2
.github/workflows/test-code.yml
vendored
2
.github/workflows/test-code.yml
vendored
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.17 AS build_base
|
||||
FROM golang:1.18 AS build_base
|
||||
|
||||
## Usage:
|
||||
## docker build . -t gokapi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.17
|
||||
FROM golang:1.18
|
||||
|
||||
## To compile:
|
||||
## cd Gokapi/build/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/forceu/gokapi
|
||||
|
||||
go 1.17
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
git.mills.io/prologic/bitcask v1.0.2
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build !integration && test
|
||||
// +build !integration,test
|
||||
|
||||
package main
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build js && wasm
|
||||
// +build js,wasm
|
||||
|
||||
package main
|
||||
|
||||
|
||||
2
go.mod
2
go.mod
@@ -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
1
go.sum
@@ -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=
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package configuration
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package cloudconfig
|
||||
|
||||
import (
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package environment
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package helper
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package helper
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package logging
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package models
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package models
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package storage
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build !noaws && !awsmock
|
||||
// +build !noaws,!awsmock
|
||||
|
||||
package aws
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build !noaws && awsmock
|
||||
// +build !noaws,awsmock
|
||||
|
||||
package aws
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build noaws
|
||||
// +build noaws
|
||||
|
||||
package aws
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build awstest && !awsmock && test
|
||||
// +build awstest,!awsmock,test
|
||||
|
||||
package aws
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package test
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package test
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package testconfiguration
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package testconfiguration
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package sessionmanager
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package downloadstatus
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package fileupload
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package ssl
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
{{define "app_name"}}Gokapi{{end}}
|
||||
{{define "version"}}1.5.1{{end}}
|
||||
{{define "version"}}1.5.2{{end}}
|
||||
|
||||
Reference in New Issue
Block a user