Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25.x"
go-version: "1.26.x"
cache: false
- name: Install gitlint
run: |
Expand All @@ -63,7 +63,7 @@ jobs:
# 'make lint-go'.
uses: golangci/golangci-lint-action@v9
with:
version: v2.6.2
version: v2.10.1
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Ensure a clean code checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25.x"
go-version: "1.26.x"
- name: Cache Go dependencies
uses: actions/cache@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
container:
image: ghcr.io/goreleaser/goreleaser-cross:v1.25
image: ghcr.io/goreleaser/goreleaser-cross:v1.26
options: --user 1001
steps:
- name: Checkout
Expand All @@ -22,13 +22,13 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25.x"
go-version: "1.26.x"
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
install-only: true
distribution: goreleaser
version: 2.13.1
version: 2.13.3
- name: Build and publish the next release
run: |
make release-build
Expand Down
2 changes: 1 addition & 1 deletion build/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (de *ContainerEnv) WrapCommand(cmd *exec.Cmd) error {
return fmt.Errorf("bad working directory: %w", err)
}

var envArgs []string //nolint: prealloc
var envArgs []string
for _, envKV := range cmd.Env {
envArgs = append(envArgs, "--env", envKV)
}
Expand Down
2 changes: 1 addition & 1 deletion build/measurement/acpi/acpi.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func GenerateTablesQemu(resources *bundle.TDXResources) ([]byte, []byte, []byte,
binary.LittleEndian.PutUint32(tpl[rangeMinimumOffset:], 0x80000000)
binary.LittleEndian.PutUint32(tpl[lengthOffset:], 0x60000000)
} else {
memSizeBytes := uint32(resources.Memory * 1024 * 1024) //nolint: gosec
memSizeBytes := uint32(resources.Memory * 1024 * 1024)
binary.LittleEndian.PutUint32(tpl[rangeMinimumOffset:], memSizeBytes)
binary.LittleEndian.PutUint32(tpl[lengthOffset:], 0xe0000000-memSizeBytes)
}
Expand Down
4 changes: 2 additions & 2 deletions build/measurement/tdx_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func encodeGUID(guid string) []byte {

// measureTdxEfiVariable measures an EFI variable event.
func measureTdxEfiVariable(vendorGUID string, varName string) []byte {
var data []byte
var data []byte //nolint: prealloc
data = append(data, encodeGUID(vendorGUID)...)

var encLen [8]byte
Expand Down Expand Up @@ -268,7 +268,7 @@ func (m *tdvfMetadata) computeMrtd(fw []byte, variant int) []byte {
// All the other bytes contain 0.
var buf [128]byte
copy(buf[:9], []byte("MR.EXTEND"))
binary.LittleEndian.PutUint64(buf[16:24], s.memoryAddress+page*pageSize+uint64(i*mrExtendGranularity)) //nolint: gosec
binary.LittleEndian.PutUint64(buf[16:24], s.memoryAddress+page*pageSize+uint64(i*mrExtendGranularity))
_, _ = h.Write(buf[:])

// The other two extension buffers contain the chunk’s content.
Expand Down
2 changes: 1 addition & 1 deletion build/rofl/scheduler/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (c *Client) post(ctx context.Context, path string, request, response any) e
}
c.mu.Unlock()

rsp, err := c.hc.Do(rq)
rsp, err := c.hc.Do(rq) //nolint: gosec
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/addressbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (
table := table.New()
table.Header("Name", "Address")

var output [][]string
var output [][]string //nolint: prealloc
for name, acc := range cfg.AddressBook.All {
addrStr := acc.Address
if ethAddr := acc.GetEthAddress(); ethAddr != nil {
Expand Down
6 changes: 3 additions & 3 deletions cmd/common/progress/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func PrintProgressBar(f io.Writer, msg string, done uint64, total uint64, final
// Note that we need to do this every time in case the user has resized their terminal.
terminalWidth := 80
if file, ok := f.(*os.File); ok {
width, _, err := term.GetSize(int(file.Fd()))
width, _, err := term.GetSize(int(file.Fd())) //nolint: gosec
// Cap the maximum width to 80 to improve readability on wide terminals.
if err == nil && width < terminalWidth {
terminalWidth = width
Expand All @@ -34,7 +34,7 @@ func PrintProgressBar(f io.Writer, msg string, done uint64, total uint64, final
// previously had a progress bar there (so that we erase it).
out := fmt.Sprintf("%s %s", msg, doneMiB)
blank := strings.Repeat(" ", terminalWidth-len(out)-1)
fmt.Fprintf(f, "\r%s%s", out, blank)
fmt.Fprintf(f, "\r%s%s", out, blank) //nolint: gosec
} else {
// If the total size is known, calculate percentage done and draw progress bar.
ratioDone := float64(done) / float64(total)
Expand All @@ -54,7 +54,7 @@ func PrintProgressBar(f io.Writer, msg string, done uint64, total uint64, final
bar := strings.Repeat("#", doneWidth)
bar += strings.Repeat(" ", availableWidth-doneWidth)

fmt.Fprintf(f, "\r%s %.2f%% [%s] %s", msg, percentDone, bar, doneMiB)
fmt.Fprintf(f, "\r%s %.2f%% [%s] %s", msg, percentDone, bar, doneMiB) //nolint: gosec
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ func parseData(data string) interface{} {
}

func parseTokens(pt *config.ParaTime, tokens []string) []types.BaseUnits {
result := []types.BaseUnits{}
result := []types.BaseUnits{} //nolint: prealloc
for _, raw := range tokens {
// TODO: Support parsing denominations.
amount, err := helpers.ParseParaTimeDenomination(pt, raw, types.NativeDenomination)
Expand Down
2 changes: 1 addition & 1 deletion cmd/network/governance/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var govListCmd = &cobra.Command{
cobra.CheckErr(fmt.Errorf("failed to fetch proposals: %w", err))
}

var output [][]string
var output [][]string //nolint: prealloc
for _, proposal := range proposals {
var kind string
switch {
Expand Down
2 changes: 1 addition & 1 deletion cmd/network/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var listCmd = &cobra.Command{
table := table.New()
table.Header("Name", "Chain Context", "RPC")

var output [][]string
var output [][]string //nolint: prealloc
for name, net := range cfg.Networks.All {
displayName := name
if cfg.Networks.Default == name {
Expand Down
2 changes: 1 addition & 1 deletion cmd/paratime/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ func prettyPrintEvent(indent string, evIndex int, ev *types.Event) {
}

func jsonPrintEvents(evs []*types.Event) {
out := []map[string]interface{}{}
out := []map[string]interface{}{} //nolint: prealloc

for _, ev := range evs {
fields := make(map[string]interface{})
Expand Down
4 changes: 2 additions & 2 deletions cmd/rofl/build/artifacts.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package build
package build //revive:disable

import (
"archive/tar"
Expand Down Expand Up @@ -42,7 +42,7 @@ func maybeDownloadArtifact(kind, uri string) string {

// In case the URI represents a local file, check that it exists and return it.
if url.Host == "" {
_, err = os.Stat(url.Path)
_, err = os.Stat(url.Path) //nolint: gosec
cobra.CheckErr(err)
return url.Path
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/rofl/build/artifacts_other.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build !unix

package build
package build //revive:disable

func setUmask(mask int) {
}
2 changes: 1 addition & 1 deletion cmd/rofl/build/artifacts_unix.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build unix

package build
package build //revive:disable

import (
"golang.org/x/sys/unix"
Expand Down
2 changes: 1 addition & 1 deletion cmd/rofl/build/build.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package build
package build //revive:disable

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion cmd/rofl/build/container.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package build
package build //revive:disable

import (
"fmt"
Expand Down
4 changes: 2 additions & 2 deletions cmd/rofl/build/scripts.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package build
package build //revive:disable

import (
"fmt"
Expand All @@ -24,7 +24,7 @@ func runScript(manifest *buildRofl.Manifest, name string, buildEnv env.ExecEnv,
if shell == "" {
shell = "/bin/sh"
}
cmd := exec.Command(shell, "-c", script)
cmd := exec.Command(shell, "-c", script) //nolint: gosec

if useContainer {
if err := buildEnv.WrapCommand(cmd); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/rofl/build/sgx.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package build
package build //revive:disable

import (
"crypto/rand"
Expand Down Expand Up @@ -80,7 +80,7 @@ func sgxBuild(

// Compute MRENCLAVE.
var b []byte
if b, err = os.ReadFile(sgxsPath); err != nil {
if b, err = os.ReadFile(sgxsPath); err != nil { //nolint: gosec
cobra.CheckErr(fmt.Errorf("failed to read SGXS binary: %w", err))
}
var enclaveHash sgx.MrEnclave
Expand Down
4 changes: 2 additions & 2 deletions cmd/rofl/build/tdx.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package build
package build //revive:disable

import (
"fmt"
Expand Down Expand Up @@ -144,7 +144,7 @@ func tdxPrepareStage2(
fmt.Printf("Runtime hash: %s\n", initHash)

// Build list of files to inject into the rootfs.
filesToInject := []extraFile{
filesToInject := []extraFile{ //nolint: prealloc
{HostPath: initPath, TarPath: "init", Mode: 0o755},
}
filesToInject = append(filesToInject, extraFiles...)
Expand Down
4 changes: 2 additions & 2 deletions cmd/rofl/build/validate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package build
package build //revive:disable

import (
"context"
Expand Down Expand Up @@ -298,7 +298,7 @@ func validateComposeFile(composeFile string, manifest *buildRofl.Manifest, opts
var imageSize uint64
for _, layer := range mf.Layers {
if layer.Size > 0 {
imageSize += uint64(layer.Size)
imageSize += uint64(layer.Size) //nolint: gosec
}
}
totalSize += imageSize
Expand Down
2 changes: 1 addition & 1 deletion cmd/rofl/provider/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func ShowOfferSummary(npa *common.NPASelection, offer *roflmarket.Offer) {
switch {
case offer.Payment.Native != nil:
if len(offer.Payment.Native.Terms) > 0 {
var terms []string
var terms []string //nolint: prealloc
for term, amount := range offer.Payment.Native.Terms {
bu := types.NewBaseUnits(amount, offer.Payment.Native.Denomination)
formattedAmount := helpers.FormatParaTimeDenomination(npa.ParaTime, bu)
Expand Down
2 changes: 1 addition & 1 deletion cmd/rofl/provider/mgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ var (
var (
add []roflmarket.Offer
update []roflmarket.Offer
remove []roflmarket.OfferID
remove []roflmarket.OfferID //nolint: prealloc
)
for _, offer := range manifest.Offers {
var offerDsc *roflmarket.Offer
Expand Down
8 changes: 4 additions & 4 deletions cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func fetchLatest(ctx context.Context) (*ghRelease, error) {
req.Header.Set("Authorization", "Bearer "+t)
}

res, err := httpClient.Do(req)
res, err := httpClient.Do(req) //nolint: gosec
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -197,7 +197,7 @@ func doDownload(ctx context.Context, url string) (string, error) {
}

req, _ := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
res, err := httpClient.Do(req)
res, err := httpClient.Do(req) //nolint: gosec
if err != nil {
return "", err
}
Expand Down Expand Up @@ -253,14 +253,14 @@ func replaceExecutable(dest string, r io.Reader, perm os.FileMode) error {
return err
}

if err = os.Rename(tmpPath, dest); err == nil {
if err = os.Rename(tmpPath, dest); err == nil { //nolint: gosec
cleanup = false
return nil
}

if runtime.GOOS == osWindows {
pending := dest + ".new"
if err2 := os.Rename(tmpPath, pending); err2 != nil {
if err2 := os.Rename(tmpPath, pending); err2 != nil { //nolint: gosec
return fmt.Errorf("rename failed (%v / %v)", err, err2)
}
scheduleWindowsMove(pending, dest)
Expand Down
2 changes: 1 addition & 1 deletion cmd/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestUpdate_PositiveFlow(t *testing.T) {
// Custom downloader that works over plain HTTP for the test server.
download = func(ctx context.Context, url string) (string, error) {
req, _ := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
res, err := http.DefaultClient.Do(req)
res, err := http.DefaultClient.Do(req) //nolint: gosec
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/wallet/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var (

if !common.GetAnswerYes() {
// Ask for import kind.
var supportedKinds []string
var supportedKinds []string //nolint: prealloc
for _, kind := range af.SupportedImportKinds() {
supportedKinds = append(supportedKinds, string(kind))
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/wallet/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var listCmd = &cobra.Command{
table := table.New()
table.Header("Account", "Kind", "Address")

var output [][]string
var output [][]string //nolint: prealloc
for name, acc := range cfg.Wallet.All {
if cfg.Wallet.Default == name {
name += common.DefaultMarker
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/oasisprotocol/cli

go 1.25.5
go 1.26.0

replace github.com/cometbft/cometbft => github.com/oasisprotocol/cometbft v0.37.15-oasis1

Expand Down
2 changes: 1 addition & 1 deletion metadata/oasisscan.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func EntitiesFromOasisscan(ctx context.Context) (map[types.Address]*Entity, erro
return nil, err
}
client := &http.Client{}
resp, err := client.Do(req)
resp, err := client.Do(req) //nolint: gosec
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package version
package version //nolint: revive

import (
"runtime"
Expand Down
2 changes: 1 addition & 1 deletion wallet/ledger/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func prepareChunks(pathBytes, context, message []byte, chunkSize int, ctxLen boo
return nil, fmt.Errorf("maximum supported context size is 255 bytes")
}

body = []byte{byte(len(context))}
body = []byte{byte(len(context))} //nolint: gosec
}
body = append(body, context...)
body = append(body, message...)
Expand Down
Loading
Loading