Skip to content

Commit 4df9462

Browse files
committed
fix ci error with golang 1.22
1 parent 27a99cd commit 4df9462

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Go
2626
uses: actions/setup-go@v5
2727
with:
28-
go-version: 1.21
28+
go-version: 1.22
2929

3030
# Download all the tools used in the steps that follow
3131
- name: Set up Tools

cmd/password-generator/main.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var (
1717
flagNoAmbiguity = flag.Bool("no-ambiguity", false, "Avoid Ambiguous Characters?")
1818
flagNumChars = flag.Int("num-chars", 12, "Number of characters in Password")
1919
flagPrintIndex = flag.Bool("index", false, "Print Index Value (1-indexed)")
20-
flagSeed = flag.Int64("seed", 0, "Seed value for non-sequenced mode (ignored if zero)")
20+
flagSeed = flag.Uint64("seed", 0, "Seed value for non-sequenced mode (ignored if zero)")
2121
flagSequenced = flag.Bool("sequenced", false, "Generate passwords in a sequence")
2222
flagStartIdx = flag.String("start", "0", "Index to start from in the sequence (1-indexed)")
2323

@@ -49,8 +49,8 @@ func main() {
4949
}
5050
printIndex := *flagPrintIndex
5151
seed := *flagSeed
52-
if seed <= 0 {
53-
seed = time.Now().UnixNano()
52+
if seed == 0 {
53+
seed = uint64(time.Now().UnixNano())
5454
}
5555
startIdx, ok := new(big.Int).SetString(*flagStartIdx, 10)
5656
if !ok {
@@ -76,7 +76,7 @@ func main() {
7676
}
7777
}
7878

79-
func generateRandomPasswords(charset password.Charset, numChars int, count *big.Int, printIndex bool, seed int64) {
79+
func generateRandomPasswords(charset password.Charset, numChars int, count *big.Int, printIndex bool, seed uint64) {
8080
generator, err := password.NewGenerator(
8181
password.WithCharset(charset),
8282
password.WithLength(numChars),

0 commit comments

Comments
 (0)