Skip to content

Commit

Permalink
style: fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
achannarasappa committed Apr 30, 2024
1 parent 2d104d7 commit 691b86f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type symbolSource struct {

// Run starts the ticker UI
func Run(uiStartFn func() error) func(*cobra.Command, []string) {
return func(cmd *cobra.Command, args []string) {
return func(_ *cobra.Command, _ []string) {
err := uiStartFn()

if err != nil {
Expand All @@ -51,7 +51,7 @@ func Run(uiStartFn func() error) func(*cobra.Command, []string) {

// Validate checks whether config is valid and returns an error if invalid or if an error was generated earlier
func Validate(ctx *c.Context, options *Options, prevErr *error) func(*cobra.Command, []string) error {
return func(cmd *cobra.Command, args []string) error {
return func(_ *cobra.Command, _ []string) error {

if prevErr != nil && *prevErr != nil {
return *prevErr
Expand Down
2 changes: 1 addition & 1 deletion internal/print/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func convertAssetsToJSON(assets []c.Asset) string {

// Run prints holdings to the terminal
func Run(dep *c.Dependencies, ctx *c.Context, options *Options) func(*cobra.Command, []string) {
return func(cmd *cobra.Command, args []string) {
return func(_ *cobra.Command, _ []string) {

assetGroupQuote := quote.GetAssetGroupQuote(*dep)(ctx.Groups[0])
assets, _ := asset.GetAssets(*ctx, assetGroupQuote)
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func generateQuoteMsg(m Model, skipUpdate bool) func() tea.Msg {
}

func (m Model) updateQuotes() tea.Cmd {
return tea.Tick(time.Second*time.Duration(m.requestInterval), func(t time.Time) tea.Msg {
return tea.Tick(time.Second*time.Duration(m.requestInterval), func(_ time.Time) tea.Msg {
return generateQuoteMsg(m, false)()
})
}
Expand Down
12 changes: 6 additions & 6 deletions test/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func MockResponse(responseParameters ResponseParameters) {
//nolint:errcheck
t.Execute(&responseBytes, responseParameters)
responseUrl := `=~\/finance\/quote.*fields\=regularMarketPrice%2Ccurrency\&symbols\=` + responseParameters.Symbol //nolint:golint,stylecheck,revive
httpmock.RegisterResponder("GET", responseUrl, func(req *http.Request) (*http.Response, error) {
httpmock.RegisterResponder("GET", responseUrl, func(_ *http.Request) (*http.Response, error) {
resp := httpmock.NewStringResponse(200, responseBytes.String())
resp.Header.Set("Content-Type", "application/json")

Expand All @@ -61,7 +61,7 @@ func MockResponseCurrency() {
}
}`
responseUrl := `=~.*\/finance\/quote.*` //nolint:golint,stylecheck,revive
httpmock.RegisterResponder("GET", responseUrl, func(req *http.Request) (*http.Response, error) {
httpmock.RegisterResponder("GET", responseUrl, func(_ *http.Request) (*http.Response, error) {
resp := httpmock.NewStringResponse(200, response)
resp.Header.Set("Content-Type", "application/json")

Expand All @@ -71,7 +71,7 @@ func MockResponseCurrency() {

func MockResponseCurrencyError() {
responseUrl := `=~.*\/finance\/quote.*` //nolint:golint,stylecheck,revive
httpmock.RegisterResponder("GET", responseUrl, func(req *http.Request) (*http.Response, error) {
httpmock.RegisterResponder("GET", responseUrl, func(_ *http.Request) (*http.Response, error) {
return &http.Response{}, errors.New("error getting currencies") //nolint:goerr113
})
}
Expand Down Expand Up @@ -124,7 +124,7 @@ func MockResponseYahooQuotes() {
}
}`
responseUrl := `=~.*\/finance\/quote.*symbols\=GOOG.*RBLX.*` //nolint:golint,stylecheck,revive
httpmock.RegisterResponder("GET", responseUrl, func(req *http.Request) (*http.Response, error) {
httpmock.RegisterResponder("GET", responseUrl, func(_ *http.Request) (*http.Response, error) {
resp := httpmock.NewStringResponse(200, response)
resp.Header.Set("Content-Type", "application/json")

Expand All @@ -144,7 +144,7 @@ func MockTickerSymbols() {
"XRP.X","ripple","cg"
`
responseUrl := "https://raw.githubusercontent.com/achannarasappa/ticker-static/master/symbols.csv" //nolint:golint,stylecheck,revive
httpmock.RegisterResponder("GET", responseUrl, func(req *http.Request) (*http.Response, error) {
httpmock.RegisterResponder("GET", responseUrl, func(_ *http.Request) (*http.Response, error) {
resp := httpmock.NewStringResponse(200, responseFixture)
resp.Header.Set("Content-Type", "text/plain; charset=utf-8")

Expand All @@ -154,7 +154,7 @@ func MockTickerSymbols() {

func MockTickerSymbolsError() {
responseUrl := "https://raw.githubusercontent.com/achannarasappa/ticker-static/master/symbols.csv" //nolint:golint,stylecheck,revive
httpmock.RegisterResponder("GET", responseUrl, func(req *http.Request) (*http.Response, error) {
httpmock.RegisterResponder("GET", responseUrl, func(_ *http.Request) (*http.Response, error) {
return &http.Response{}, errors.New("error getting ticker symbols") //nolint:goerr113
})
}

0 comments on commit 691b86f

Please sign in to comment.