Skip to content

Commit 34523d5

Browse files
committed
ci: Fix linter issues
1 parent b716cae commit 34523d5

File tree

29 files changed

+44
-44
lines changed

29 files changed

+44
-44
lines changed

build/env/env.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (de *ContainerEnv) WrapCommand(cmd *exec.Cmd) error {
123123
return fmt.Errorf("bad working directory: %w", err)
124124
}
125125

126-
var envArgs []string //nolint: prealloc
126+
var envArgs []string
127127
for _, envKV := range cmd.Env {
128128
envArgs = append(envArgs, "--env", envKV)
129129
}

build/measurement/acpi/acpi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func GenerateTablesQemu(resources *bundle.TDXResources) ([]byte, []byte, []byte,
7171
binary.LittleEndian.PutUint32(tpl[rangeMinimumOffset:], 0x80000000)
7272
binary.LittleEndian.PutUint32(tpl[lengthOffset:], 0x60000000)
7373
} else {
74-
memSizeBytes := uint32(resources.Memory * 1024 * 1024) //nolint: gosec
74+
memSizeBytes := uint32(resources.Memory * 1024 * 1024)
7575
binary.LittleEndian.PutUint32(tpl[rangeMinimumOffset:], memSizeBytes)
7676
binary.LittleEndian.PutUint32(tpl[lengthOffset:], 0xe0000000-memSizeBytes)
7777
}

build/measurement/tdx_qemu.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func encodeGUID(guid string) []byte {
197197

198198
// measureTdxEfiVariable measures an EFI variable event.
199199
func measureTdxEfiVariable(vendorGUID string, varName string) []byte {
200-
var data []byte
200+
var data []byte //nolint: prealloc
201201
data = append(data, encodeGUID(vendorGUID)...)
202202

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

274274
// The other two extension buffers contain the chunk’s content.

build/rofl/scheduler/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (c *Client) post(ctx context.Context, path string, request, response any) e
120120
}
121121
c.mu.Unlock()
122122

123-
rsp, err := c.hc.Do(rq)
123+
rsp, err := c.hc.Do(rq) //nolint: gosec
124124
if err != nil {
125125
return err
126126
}

cmd/addressbook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var (
2828
table := table.New()
2929
table.Header("Name", "Address")
3030

31-
var output [][]string
31+
var output [][]string //nolint: prealloc
3232
for name, acc := range cfg.AddressBook.All {
3333
addrStr := acc.Address
3434
if ethAddr := acc.GetEthAddress(); ethAddr != nil {

cmd/common/progress/progress.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func PrintProgressBar(f io.Writer, msg string, done uint64, total uint64, final
1818
// Note that we need to do this every time in case the user has resized their terminal.
1919
terminalWidth := 80
2020
if file, ok := f.(*os.File); ok {
21-
width, _, err := term.GetSize(int(file.Fd()))
21+
width, _, err := term.GetSize(int(file.Fd())) //nolint: gosec
2222
// Cap the maximum width to 80 to improve readability on wide terminals.
2323
if err == nil && width < terminalWidth {
2424
terminalWidth = width
@@ -34,7 +34,7 @@ func PrintProgressBar(f io.Writer, msg string, done uint64, total uint64, final
3434
// previously had a progress bar there (so that we erase it).
3535
out := fmt.Sprintf("%s %s", msg, doneMiB)
3636
blank := strings.Repeat(" ", terminalWidth-len(out)-1)
37-
fmt.Fprintf(f, "\r%s%s", out, blank)
37+
fmt.Fprintf(f, "\r%s%s", out, blank) //nolint: gosec
3838
} else {
3939
// If the total size is known, calculate percentage done and draw progress bar.
4040
ratioDone := float64(done) / float64(total)
@@ -54,7 +54,7 @@ func PrintProgressBar(f io.Writer, msg string, done uint64, total uint64, final
5454
bar := strings.Repeat("#", doneWidth)
5555
bar += strings.Repeat(" ", availableWidth-doneWidth)
5656

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

cmd/contract.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ func parseData(data string) interface{} {
474474
}
475475

476476
func parseTokens(pt *config.ParaTime, tokens []string) []types.BaseUnits {
477-
result := []types.BaseUnits{}
477+
result := []types.BaseUnits{} //nolint: prealloc
478478
for _, raw := range tokens {
479479
// TODO: Support parsing denominations.
480480
amount, err := helpers.ParseParaTimeDenomination(pt, raw, types.NativeDenomination)

cmd/network/governance/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var govListCmd = &cobra.Command{
3535
cobra.CheckErr(fmt.Errorf("failed to fetch proposals: %w", err))
3636
}
3737

38-
var output [][]string
38+
var output [][]string //nolint: prealloc
3939
for _, proposal := range proposals {
4040
var kind string
4141
switch {

cmd/network/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var listCmd = &cobra.Command{
2020
table := table.New()
2121
table.Header("Name", "Chain Context", "RPC")
2222

23-
var output [][]string
23+
var output [][]string //nolint: prealloc
2424
for name, net := range cfg.Networks.All {
2525
displayName := name
2626
if cfg.Networks.Default == name {

cmd/paratime/show.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ func prettyPrintEvent(indent string, evIndex int, ev *types.Event) {
449449
}
450450

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

454454
for _, ev := range evs {
455455
fields := make(map[string]interface{})

0 commit comments

Comments
 (0)