From f367d220ff99eaee7debb234c3234de6c781359c Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Fri, 30 Oct 2020 20:40:17 +0100 Subject: refactor types and documentation Structured files a bit better, added more documentation, switched to pointers as default (unless specifically motivated not to do so), and encapsulated TLS (un)marshaling for the respective types that use it. --- server/testdata/entry/main.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'server') diff --git a/server/testdata/entry/main.go b/server/testdata/entry/main.go index a849c50..7ab6d4d 100644 --- a/server/testdata/entry/main.go +++ b/server/testdata/entry/main.go @@ -8,7 +8,6 @@ import ( "io/ioutil" "github.com/golang/glog" - "github.com/google/certificate-transparency-go/tls" "github.com/system-transparency/stfe" ) @@ -26,10 +25,9 @@ func main() { checksum := hasher.Sum(nil) // Create and serialize an StItem of type checksum_v1 - item := stfe.NewChecksumV1([]byte(*name), checksum) - serialized, err := tls.Marshal(item) + serialized, err := stfe.NewChecksumV1([]byte(*name), checksum).Marshal() if err != nil { - glog.Fatalf("tls marshal failed: %v", err) + glog.Fatalf("%v", err) } // Store the serialized item in *dir/name -- cgit v1.2.3