fix parsing, fix new line

This commit is contained in:
2025-08-12 21:07:41 +02:00
parent 61eab24ba4
commit e025b06a12
2 changed files with 4 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ func (p *CRC32Cmd) Execute(ctx context.Context, f *flag.FlagSet, args ...interfa
if len(p.table) > 0 { if len(p.table) > 0 {
param, err = parse(p.table) param, err = parse(p.table)
if err != nil { if err != nil {
fmt.Printf("Available tables: IEEE Castagnoli Koopman") fmt.Println("Available tables: IEEE Castagnoli Koopman")
return subcommands.ExitFailure return subcommands.ExitFailure
} }
} }

View File

@@ -42,7 +42,7 @@ func (p *CRC64Cmd) Execute(ctx context.Context, f *flag.FlagSet, args ...interfa
if len(p.table) > 0 { if len(p.table) > 0 {
param, err = parse(p.table) param, err = parse(p.table)
if err != nil { if err != nil {
fmt.Printf("Available tables: IEEE Castagnoli Koopman") fmt.Println("Available tables: ISO ECMA")
return subcommands.ExitFailure return subcommands.ExitFailure
} }
} }
@@ -71,9 +71,9 @@ func (p *CRC64Cmd) Execute(ctx context.Context, f *flag.FlagSet, args ...interfa
func parse(tableName string) (uint64, error) { func parse(tableName string) (uint64, error) {
switch tableName { switch tableName {
case "Castagnoli": case "ISO":
return crc64.ISO, nil return crc64.ISO, nil
case "Koopman": case "ECMA":
return crc64.ECMA, nil return crc64.ECMA, nil
} }
return 0, fmt.Errorf("invalid table name: %s", tableName) return 0, fmt.Errorf("invalid table name: %s", tableName)