Skip to content

Commit

Permalink
Add FormatDiscriminator
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Oct 26, 2022
1 parent c3e479f commit 1551bbe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ func FormatByteSlice(buf []byte) string {
elems = append(elems, strconv.Itoa(int(v)))
}

return "[" + strings.Join(elems, ", ") + "]" + fmt.Sprintf("(len=%v)", len(elems))
return "{" + strings.Join(elems, ", ") + "}" + fmt.Sprintf("(len=%v)", len(elems))
}

func FormatDiscriminator(disc [8]byte) string {
elems := make([]string, 0)
for _, v := range disc {
elems = append(elems, strconv.Itoa(int(v)))
}
return "[8]{" + strings.Join(elems, ", ") + "}"
}

type WriteByWrite struct {
Expand Down

0 comments on commit 1551bbe

Please sign in to comment.