Skip to content

Commit

Permalink
fix lint and update go version
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Jun 29, 2024
1 parent 33914e4 commit c8c9587
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Set up Go 1.19
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
id: go

- name: Libraries for gio
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ the supported instant exchange are: [trocador](https://trocador.app/),

For taking the api keys. Please go to the instant exchange websites

Note: You need to have [Go 1.19](https://golang.org/dl/) or above to build.
Note: You need to have [Go 1.21](https://golang.org/dl/) or above to build.

Then `go build`.

Expand Down
2 changes: 1 addition & 1 deletion app/widgetdisplaypage.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewWidgetDisplayPage(widget layout.Widget) *WidgetDisplayPage {
func (*WidgetDisplayPage) OnNavigatedTo() {}

// HandleUserInteractions implements Page.
func (*WidgetDisplayPage) HandleUserInteractions(gtx layout.Context) {}
func (*WidgetDisplayPage) HandleUserInteractions(_ layout.Context) {}

// Layout implements Page.
func (pg *WidgetDisplayPage) Layout(gtx layout.Context) layout.Dimensions {
Expand Down
4 changes: 2 additions & 2 deletions app/window_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (tPage *testPage) OnNavigatedTo() {
tPage.calledMethod(pageMethodOnNavigatedTo)
}

func (tPage *testPage) HandleUserInteractions(gtx layout.Context) {
func (tPage *testPage) HandleUserInteractions(_ layout.Context) {
tPage.calledMethod(pageMethodHandleUserInteractions)
}

Expand Down Expand Up @@ -190,7 +190,7 @@ func (tModal *testModal) OnResume() {
tModal.calledMethod(modalMethodOnResume)
}

func (tModal *testModal) Handle(gtx layout.Context) {
func (tModal *testModal) Handle(_ layout.Context) {
tModal.calledMethod(modalMethodHandle)
}

Expand Down
2 changes: 1 addition & 1 deletion libwallet/libwallet_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import (

func TestLibwallet(t *testing.T) {
gomega.RegisterFailHandler(ginkgo.Fail)
rand.Seed(ginkgo.GinkgoRandomSeed())
rand.New(rand.NewSource(ginkgo.GinkgoRandomSeed()))
ginkgo.RunSpecs(t, "Libwallet Suite")
}
4 changes: 2 additions & 2 deletions ui/cryptomaterial/progressbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ func (p ProgressBarStyle) Layout(gtx C) D {

progressBarWidth := int(p.Width)
return layout.Stack{Alignment: layout.W}.Layout(gtx,
layout.Stacked(func(gtx C) D {
layout.Stacked(func(_ C) D {
return shader(progressBarWidth, p.TrackColor)
}),
layout.Stacked(func(gtx C) D {
layout.Stacked(func(_ C) D {
fillWidth := int(float32(progressBarWidth) * clamp1(p.Progress))
fillColor := p.Color
fillColor = Disabled(fillColor)
Expand Down
2 changes: 1 addition & 1 deletion ui/cryptomaterial/theme.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func approxLuminance(c color.NRGBA) byte {
return byte((r*int(c.R) + g*int(c.G) + b*int(c.B)) / t)
}

func HandleEditorEvents(gtx C, editors ...*Editor) (bool, bool) {
func HandleEditorEvents(_ C, editors ...*Editor) (bool, bool) {
var submit, changed bool
for _, editor := range editors {
submit = submit || editor.Submitted()
Expand Down
3 changes: 1 addition & 2 deletions ui/page/components/votebar_widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ func (v *VoteBar) votesIndicatorTooltip(gtx C, r image.Rectangle, tipPos float32
inset := layout.Inset{Left: gtx.Metric.PxToDp(int(insetLeft)), Top: values.MarginPadding25}
v.passTooltip.Layout(gtx, r, inset, func(gtx C) D {
txt := values.StringF(values.StrVoteTooltip, int(v.passPercentage))
cap := v.Theme.Caption(txt).Layout(gtx)
return cap
return v.Theme.Caption(txt).Layout(gtx)
})
}

Expand Down
2 changes: 1 addition & 1 deletion ui/page/governance/proposals_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (pg *ProposalsPage) HandleUserInteractions(gtx C) {
}

for pg.syncButton.Clicked(gtx) {
go func() { pg.AssetsManager.Politeia.Sync(context.Background()) }()
go func() { _ = pg.AssetsManager.Politeia.Sync(context.Background()) }()
pg.isSyncing = true

// TODO: check after 1min if sync does not start, set isSyncing to false and cancel sync
Expand Down
2 changes: 1 addition & 1 deletion ui/page/security/sign_message_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (pg *SignMessagePage) handleEditorEvents(gtx C) {
// used to update the page's UI components shortly before they are
// displayed.
// Part of the load.Page interface.
func (pg *SignMessagePage) HandleUserInteractions(gtx C) {
func (pg *SignMessagePage) HandleUserInteractions(_ C) {
pg.updateButtonColors()
}

Expand Down
2 changes: 1 addition & 1 deletion ui/page/settings/log_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (pg *LogPage) layoutMobile(gtx layout.Context) layout.Dimensions {
// used to update the page's UI components shortly before they are
// displayed.
// Part of the load.Page interface.
func (pg *LogPage) HandleUserInteractions(gtx C) {}
func (pg *LogPage) HandleUserInteractions(_ C) {}

// OnNavigatedFrom is called when the page is about to be removed from
// the displayed window. This method should ideally be used to disable
Expand Down
2 changes: 1 addition & 1 deletion ui/page/settings/statistics_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func (pg *StatPage) appStartTime() {
// used to update the page's UI components shortly before they are
// displayed.
// Part of the load.Page interface.
func (pg *StatPage) HandleUserInteractions(gtx C) {
func (pg *StatPage) HandleUserInteractions(_ C) {
pg.appStartTime()
}

Expand Down

0 comments on commit c8c9587

Please sign in to comment.