Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Harry Randazzo <[email protected]>
  • Loading branch information
Noxsios committed Dec 23, 2024
1 parent 354a0da commit af8920c
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ words:
test:
go test ./...

.PHONY: build clean words test
lint:
golangci-lint run ./...

.PHONY: build clean words test lint
4 changes: 4 additions & 0 deletions count/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2024-Present Harry Randazzo

// Package main is the entrypoint for some misc CLIs
package main

import (
Expand Down
9 changes: 8 additions & 1 deletion gen/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2024-Present Harry Randazzo

// Package main is the entrypoint for generating words/gen.go from /usr/share/dict/words
package main

import (
Expand Down Expand Up @@ -27,7 +31,10 @@ func main() {
}

tmpl := template.New("words")
tmpl, err = tmpl.Parse(`package words
tmpl, err = tmpl.Parse(`// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2024-Present Harry Randazzo
package words
// generated by go run gen/main.go > words/gen.go DO NOT EDIT
Expand Down
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2024-Present Harry Randazzo

// Package main is the entrypoint for the ezpass CLI
package main

import (
Expand Down
9 changes: 7 additions & 2 deletions words/ezpass.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2024-Present Harry Randazzo

// Package words contains the generated wordlist and passphrase printer
package words

import (
Expand All @@ -7,11 +11,12 @@ import (
"math/big"
)

// PrintEzpass prints to wr a random passphrase of n words separated by a given delimiter
func PrintEzpass(wr io.Writer, n int, delimiter string) error {
max := big.NewInt(int64(len(ALL)))
upper := big.NewInt(int64(len(ALL)))

for i := range n {
randBigInt, err := rand.Int(rand.Reader, max)
randBigInt, err := rand.Int(rand.Reader, upper)
if err != nil {
return err
}
Expand Down
3 changes: 3 additions & 0 deletions words/ezpass_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2024-Present Harry Randazzo

package words_test

import (
Expand Down
3 changes: 3 additions & 0 deletions words/gen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2024-Present Harry Randazzo

package words

// generated by go run gen/main.go > words/gen.go DO NOT EDIT
Expand Down

0 comments on commit af8920c

Please sign in to comment.