Skip to content

Commit 2e31e4a

Browse files
committed
Small tweaks to the code and go.mod
1 parent f096751 commit 2e31e4a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

cmd/namigo/sub/command.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package sub
22

33
import (
4+
"errors"
45
"fmt"
56
"sync"
67
"time"
@@ -45,6 +46,9 @@ func (p *portfolio) wait() {
4546

4647
func SearchAction(c *cli.Context) error {
4748
searchTerm := c.Args().First()
49+
if len(searchTerm) == 0 {
50+
return errors.New("Provide at least one search term")
51+
}
4852

4953
maxResultsToPrint := c.Int("max")
5054

go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ module github.com/huangsam/namigo
22

33
go 1.24
44

5-
require github.com/PuerkitoBio/goquery v1.10.2
5+
require (
6+
github.com/PuerkitoBio/goquery v1.10.2
7+
github.com/urfave/cli/v2 v2.27.5
8+
)
69

710
require (
811
github.com/andybalholm/cascadia v1.3.3 // indirect
912
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
1013
github.com/russross/blackfriday/v2 v2.1.0 // indirect
11-
github.com/urfave/cli/v2 v2.27.5 // indirect
1214
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
1315
golang.org/x/net v0.35.0 // indirect
1416
)

0 commit comments

Comments
 (0)