1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Bumped Go version to Go 1.21. Using log/slog instead of golang.org/x/exp/slog

This commit is contained in:
Christian Banse 2024-04-23 15:37:43 +02:00
parent fb1cf32e17
commit 9b1480ae3d
19 changed files with 21 additions and 33 deletions

View file

@ -59,7 +59,7 @@ Download the binaries from the most recent release assets on Github.
### Build from sources
- A recent version of **Go** (1.20+) should be installed. [Go installation](https://go.dev/doc/install)
- A recent version of **Go** (1.21+) should be installed. [Go installation](https://go.dev/doc/install)
- Clone the repository `git clone https://github.com/csaf-poc/csaf_distribution.git `

View file

@ -12,6 +12,7 @@ import (
"crypto/tls"
"errors"
"fmt"
"log/slog"
"net/http"
"os"
"runtime"
@ -25,7 +26,6 @@ import (
"github.com/csaf-poc/csaf_distribution/v3/internal/models"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
"github.com/csaf-poc/csaf_distribution/v3/util"
"golang.org/x/exp/slog"
"golang.org/x/time/rate"
)

View file

@ -11,6 +11,7 @@ package main
import (
"errors"
"fmt"
"log/slog"
"os"
"path/filepath"
"strings"
@ -19,7 +20,6 @@ import (
"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v3/util"
"golang.org/x/exp/slog"
)
type fullJob struct {

View file

@ -9,11 +9,11 @@
package main
import (
"log/slog"
"os"
"path/filepath"
"github.com/csaf-poc/csaf_distribution/v3/util"
"golang.org/x/exp/slog"
)
type lazyTransaction struct {

View file

@ -11,13 +11,13 @@ package main
import (
"fmt"
"log/slog"
"os"
"path/filepath"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
"github.com/gofrs/flock"
"golang.org/x/exp/slog"
)
func lock(lockFile *string, fn func() error) error {

View file

@ -10,6 +10,7 @@ package main
import (
"fmt"
"log/slog"
"os"
"path/filepath"
@ -17,7 +18,6 @@ import (
"github.com/csaf-poc/csaf_distribution/v3/util"
"github.com/ProtonMail/gopenpgp/v2/crypto"
"golang.org/x/exp/slog"
)
type processor struct {

View file

@ -13,13 +13,12 @@ import (
"fmt"
"io"
"log"
"log/slog"
"net/http"
"os"
"path/filepath"
"time"
"golang.org/x/exp/slog"
"github.com/csaf-poc/csaf_distribution/v3/internal/certs"
"github.com/csaf-poc/csaf_distribution/v3/internal/filter"
"github.com/csaf-poc/csaf_distribution/v3/internal/models"

View file

@ -19,6 +19,7 @@ import (
"fmt"
"hash"
"io"
"log/slog"
"net/http"
"net/url"
"os"
@ -29,8 +30,6 @@ import (
"sync"
"time"
"golang.org/x/exp/slog"
"github.com/ProtonMail/gopenpgp/v2/crypto"
"golang.org/x/time/rate"

View file

@ -12,14 +12,13 @@ import (
"bytes"
"crypto/tls"
"io"
"log/slog"
"mime/multipart"
"net/http"
"os"
"path/filepath"
"strings"
"golang.org/x/exp/slog"
"github.com/csaf-poc/csaf_distribution/v3/internal/misc"
"github.com/csaf-poc/csaf_distribution/v3/util"
)

View file

@ -14,6 +14,7 @@ import (
"encoding/json"
"errors"
"io"
"log/slog"
"mime"
"mime/multipart"
"net/http"
@ -22,8 +23,6 @@ import (
"strings"
"testing"
"golang.org/x/exp/slog"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
"github.com/csaf-poc/csaf_distribution/v3/util"
)

View file

@ -11,11 +11,10 @@ package main
import (
"context"
"log/slog"
"os"
"os/signal"
"golang.org/x/exp/slog"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
)

View file

@ -8,7 +8,7 @@
package main
import "golang.org/x/exp/slog"
import "log/slog"
// stats contains counters of the downloads.
type stats struct {

View file

@ -11,9 +11,8 @@ package main
import (
"bytes"
"encoding/json"
"log/slog"
"testing"
"golang.org/x/exp/slog"
)
func TestStatsAdd(t *testing.T) {

View file

@ -3,7 +3,7 @@
## Supported Go versions
We support the latest version and the one before
the latest version of Go (currently 1.21 and 1.20).
the latest version of Go (currently 1.22 and 1.21).
## Generated files

3
go.mod
View file

@ -1,6 +1,6 @@
module github.com/csaf-poc/csaf_distribution/v3
go 1.20
go 1.21
require (
github.com/BurntSushi/toml v1.3.2
@ -14,7 +14,6 @@ require (
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
go.etcd.io/bbolt v1.3.8
golang.org/x/crypto v0.14.0
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f
golang.org/x/term v0.13.0
golang.org/x/time v0.3.0
)

5
go.sum
View file

@ -42,6 +42,7 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=
go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
@ -51,10 +52,6 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY=
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=

View file

@ -9,9 +9,8 @@
package options
import (
"log/slog"
"strings"
"golang.org/x/exp/slog"
)
// LogLevel implements a helper type to be used in configurations.

View file

@ -9,9 +9,8 @@
package options
import (
"log/slog"
"testing"
"golang.org/x/exp/slog"
)
func TestMarshalFlag(t *testing.T) {

View file

@ -12,14 +12,14 @@ package options
import (
"fmt"
"log"
"log/slog"
"os"
"github.com/csaf-poc/csaf_distribution/v3/util"
"github.com/BurntSushi/toml"
"github.com/jessevdk/go-flags"
"github.com/mitchellh/go-homedir"
"github.com/csaf-poc/csaf_distribution/v3/util"
"golang.org/x/exp/slog"
)
// Parser helps parsing command line arguments and loading