Skip to content
Snippets Groups Projects
Unverified Commit 8cb2ceba authored by dlorenc's avatar dlorenc Committed by GitHub
Browse files

Switch to using the swag library for pointer manipulation. (#719)


And also handle the roothash.

Signed-off-by: default avatarDan Lorenc <lorenc.d@gmail.com>
parent 5e5aa9ba
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ import ( ...@@ -25,6 +25,7 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/go-openapi/swag"
"github.com/google/trillian/merkle/logverifier" "github.com/google/trillian/merkle/logverifier"
"github.com/google/trillian/merkle/rfc6962" "github.com/google/trillian/merkle/rfc6962"
"github.com/spf13/cobra" "github.com/spf13/cobra"
...@@ -113,18 +114,11 @@ var logInfoCmd = &cobra.Command{ ...@@ -113,18 +114,11 @@ var logInfoCmd = &cobra.Command{
return nil, errors.New("signature on tree head did not verify") return nil, errors.New("signature on tree head did not verify")
} }
pToInt := func(p *int64) int64 {
if p == nil {
return 0
}
return *p
}
cmdOutput := &logInfoCmdOutput{ cmdOutput := &logInfoCmdOutput{
TreeSize: pToInt(logInfo.TreeSize), TreeSize: swag.Int64Value(logInfo.TreeSize),
RootHash: *logInfo.RootHash, RootHash: swag.StringValue(logInfo.RootHash),
TimestampNanos: sth.GetTimestamp(), TimestampNanos: sth.GetTimestamp(),
TreeID: pToInt(logInfo.TreeID), TreeID: swag.Int64Value(logInfo.TreeID),
} }
oldState := state.Load(serverURL) oldState := state.Load(serverURL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment