Skip to content

Commit

Permalink
init slice
Browse files Browse the repository at this point in the history
  • Loading branch information
parMaster committed Dec 1, 2024
1 parent c7a670e commit 0453171
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 2020/02-password-philosophy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ func read(filename string) []policy {
fc, _ := os.ReadFile(filename)

lines := strings.Split(strings.TrimSpace(string(fc)), "\n")
pa := []policy{}
var pa []policy
for _, line := range lines {
pt := strings.Split(line, " ")
p := policy{}
var p policy
json.Unmarshal([]byte("["+strings.Replace(pt[0], "-", ",", 1)+"]"), &p.in)
p.char = string(pt[1][0])
p.password = pt[2]
Expand Down

0 comments on commit 0453171

Please sign in to comment.