refactoring
This commit is contained in:
parent
a1739902e2
commit
e71cd8a105
2 changed files with 5 additions and 2 deletions
|
@ -2,6 +2,7 @@ package commands
|
|||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
@ -53,7 +54,7 @@ func (command *MparUnpackCommand) Execute(args []string) error {
|
|||
)
|
||||
|
||||
if len(pdata[32:]) != len(pdata)-32 {
|
||||
panic("bla")
|
||||
return errors.New("something doesnt add up")
|
||||
}
|
||||
if len(pdata[32:]) != int(fpHeader.TotalSize)-32 {
|
||||
log.Error().Uint32("header ts", fpHeader.TotalSize).Uint32("len pdata", uint32(len(pdata))).Msg("size mismatch")
|
||||
|
|
4
main.go
4
main.go
|
@ -11,10 +11,12 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
||||
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
||||
|
||||
consoleWriter := zerolog.ConsoleWriter{Out: os.Stdout}
|
||||
consoleWriter.PartsExclude = []string{
|
||||
zerolog.TimestampFieldName,
|
||||
}
|
||||
log.Logger = log.Output(consoleWriter)
|
||||
//
|
||||
parser := flags.NewParser(&commands.MotoCLI, flags.HelpFlag|flags.PassDoubleDash)
|
||||
|
|
Loading…
Add table
Reference in a new issue