Skip to content

Commit

Permalink
general: lint and document
Browse files Browse the repository at this point in the history
  • Loading branch information
rorycl committed Jan 22, 2025
1 parent 8a99fc7 commit 60d80b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions cex.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
// Example usage:
//
// postcode := "S10 1LT" // royal armouries museum, leeds
// kit := cex.NewCex()cex.Search(queries, strict, postcode)
// kit := cex.NewCex()
// cex.Search(queries, strict, postcode)
// results, err := kit.Search(queries, strict)
// if err != nil {
// log.Fatal(err)
Expand Down Expand Up @@ -110,7 +111,7 @@ func (b *Box) StoresString(length int) string {
return storeString
}

storeString += fmt.Sprintf("%s", b.Stores[0])
storeString += b.Stores[0].String()
for _, s := range b.Stores[1:] {
storeString += fmt.Sprintf(", %s", s)
}
Expand Down
7 changes: 5 additions & 2 deletions cmd/console/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func newInModel() inModel {
p.Cursor.Style = postcodeNormalStyle
p.CharLimit = 8
p.Placeholder = "postcode"
p.PromptStyle = postcodeNormalStyle
p.PromptStyle = postcodeFocusedStyle
p.Width = 12

return inModel{
Expand Down Expand Up @@ -152,9 +152,12 @@ func (in inModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
}
}
cmds := []tea.Cmd{}
in.input, cmd = in.input.Update(msg)
cmds = append(cmds, cmd)
in.postcode, cmd = in.postcode.Update(msg)
return in, cmd
cmds = append(cmds, cmd)
return in, tea.Batch(cmds...)
}

// enter event message
Expand Down
11 changes: 5 additions & 6 deletions cmd/web/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ type server struct {
// searcher is an indirect of cex.Search to allow testing
searcher func(cex *cexfind.CexFind, queries []string, strict bool, postcode string) ([]cex.Box, error)

inDevelopment bool
staticDirDev string
tplDirDev string
staticDir string
tplDir string
DirFS *fileSystem
staticDirDev string
tplDirDev string
staticDir string
tplDir string
DirFS *fileSystem

// serveFunc is an indirect for the main server functionality,
// provided for testing
Expand Down

0 comments on commit 60d80b9

Please sign in to comment.