Skip to content

Commit

Permalink
Support for go1.21 (#932)
Browse files Browse the repository at this point in the history
* Use go1.21

* Upgrade backend dependencies

* Update github-actions

* Cleanup formatting using gofumpt

* Rollback changes to dependencies. Only bump patch versions

* Cleanup go.sum file

---------

Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
  • Loading branch information
gaby and hengfeiyang committed Jan 14, 2024
1 parent 4c8d1d7 commit 962a87d
Show file tree
Hide file tree
Showing 46 changed files with 236 additions and 241 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.224.3/containers/javascript-node/.devcontainer/base.Dockerfile

# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster
ARG VARIANT="16-bullseye"
ARG VARIANT="18-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Expand Up @@ -11,12 +11,12 @@ jobs:
ZINC_ENABLE_TEXT_KEYWORD_MAPPING: true
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- run: echo "🍏 This job's status is ${{ job.status }}."
- run: cd web && npm i && npm run build && cd ..
- run: go test ./... -race -covermode=atomic -coverprofile=coverage.out
- name: Codecov
uses: codecov/codecov-action@v3.1.0
uses: codecov/codecov-action@v3.1.4

4 changes: 2 additions & 2 deletions Dockerfile
Expand Up @@ -2,7 +2,7 @@
############################
# STEP 1 build web dist
############################
FROM node:18.16.0-slim as webBuilder
FROM node:18.18.2-slim as webBuilder
WORKDIR /web
COPY ./web /web/

Expand All @@ -13,7 +13,7 @@ RUN npm run build
# STEP 2 build executable binary
############################
# FROM golang:alpine AS builder
FROM public.ecr.aws/docker/library/golang:1.19 as builder
FROM public.ecr.aws/docker/library/golang:1.21 as builder
ARG VERSION
ARG COMMIT_HASH
ARG BUILD_DATE
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ci
Expand Up @@ -15,7 +15,7 @@
# STEP 2 build executable binary
############################
# FROM golang:alpine AS builder
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/golang:1.19 as builder
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/golang:1.21 as builder
ARG VERSION
ARG COMMIT_HASH
ARG BUILD_DATE
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.hub
Expand Up @@ -2,7 +2,7 @@
############################
# STEP 1 build web dist
############################
FROM node:18.16.0-slim as webBuilder
FROM node:18.18.2-slim as webBuilder
WORKDIR /web
COPY ./web /web/

Expand All @@ -13,7 +13,7 @@ RUN npm run build
# STEP 2 build executable binary
############################
# FROM golang:alpine AS builder
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/golang:1.19 as builder
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/golang:1.21 as builder
ARG VERSION
ARG COMMIT_HASH
ARG BUILD_DATE
Expand Down
3 changes: 0 additions & 3 deletions cmd/zincsearch/main.go
Expand Up @@ -103,7 +103,6 @@ func main() {
})

err := func() error {

log.Info().Msg("Listen on " + server.Addr)

if config.Global.ServerTLSCertificateFile != "" && config.Global.ServerTLSKeyFile != "" {
Expand All @@ -129,9 +128,7 @@ func main() {
}

return server.ListenAndServe()

}()

if err != nil {
if err == http.ErrServerClosed {
log.Info().Msg("Server closed")
Expand Down
107 changes: 54 additions & 53 deletions go.mod
@@ -1,6 +1,6 @@
module github.com/zincsearch/zincsearch

go 1.18
go 1.21

require (
github.com/blugelabs/bluge v0.1.9
Expand All @@ -16,112 +16,113 @@ require (
github.com/go-ego/gse v0.80.2
github.com/goccy/go-json v0.10.2
github.com/joho/godotenv v1.4.0
github.com/prometheus/client_golang v1.15.0
github.com/prometheus/client_golang v1.15.1
github.com/pyroscope-io/client v0.6.0
github.com/robfig/cron/v3 v3.0.1
github.com/rs/zerolog v1.29.0
github.com/rs/zerolog v1.29.1
github.com/segmentio/analytics-go/v3 v3.2.1
github.com/shirou/gopsutil/v3 v3.23.2
github.com/stretchr/testify v1.8.3
github.com/shirou/gopsutil/v3 v3.23.10
github.com/stretchr/testify v1.8.4
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a
github.com/swaggo/gin-swagger v1.5.3
github.com/swaggo/swag v1.8.11
github.com/swaggo/swag v1.8.12
github.com/zincsearch/go-gin-prometheus v0.1.1
github.com/zincsearch/wal v1.2.6
go.etcd.io/bbolt v1.3.6
go.etcd.io/etcd/client/v3 v3.5.7
golang.org/x/crypto v0.9.0
golang.org/x/sync v0.1.0
golang.org/x/text v0.9.0
go.etcd.io/bbolt v1.3.8
go.etcd.io/etcd/client/v3 v3.5.10
golang.org/x/crypto v0.14.0
golang.org/x/sync v0.3.0
golang.org/x/text v0.13.0
)

require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/RoaringBitmap/roaring v0.9.4 // indirect
github.com/axiomhq/hyperloglog v0.0.0-20191112132149-a4c4c47bc57f // indirect
github.com/axiomhq/hyperloglog v0.0.0-20230201085229-3ddf4bad03dc // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.2.0 // indirect
github.com/bits-and-blooms/bitset v1.2.2 // indirect
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
github.com/blevesearch/mmap-go v1.0.4 // indirect
github.com/blevesearch/segment v0.9.0 // indirect
github.com/blevesearch/segment v0.9.1 // indirect
github.com/blevesearch/snowballstem v0.9.0 // indirect
github.com/blevesearch/vellum v1.0.7 // indirect
github.com/blevesearch/vellum v1.0.10 // indirect
github.com/blugelabs/bluge_segment_api v0.2.0 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/bytedance/sonic v1.10.2 // indirect
github.com/caio/go-tdigest v3.1.0+incompatible // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/spec v0.20.4 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/go-playground/validator/v10 v10.14.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/flatbuffers v1.12.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/pyroscope-io/godeltaprof v0.1.2 // indirect
github.com/segmentio/backo-go v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/segmentio/backo-go v1.0.1 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tidwall/tinylru v1.1.0 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/vcaesar/cedar v0.20.1 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.etcd.io/etcd/api/v3 v3.5.7 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect
go.opencensus.io v0.22.5 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
go.opencensus.io v0.22.6 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/grpc v1.41.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down

0 comments on commit 962a87d

Please sign in to comment.