summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-09-28 17:49:28 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-09-28 17:49:28 +0200
commitd39cf35cc43d418b1ad5a5f14c1698d8665dfc60 (patch)
tree561770bf81c6e4d51561f59e5559708f8bf24533
parent7bc91ea34c339f78a0ffae8a53c88dda5ef5340a (diff)
added Go snippet to test cgit setup
-rw-r--r--cmd/go.mod3
-rw-r--r--cmd/main.go22
2 files changed, 25 insertions, 0 deletions
diff --git a/cmd/go.mod b/cmd/go.mod
new file mode 100644
index 0000000..2649964
--- /dev/null
+++ b/cmd/go.mod
@@ -0,0 +1,3 @@
+module example.com
+
+go 1.14
diff --git a/cmd/main.go b/cmd/main.go
new file mode 100644
index 0000000..3ea277e
--- /dev/null
+++ b/cmd/main.go
@@ -0,0 +1,22 @@
+package main
+
+//
+// $ go run .
+// main.go:9:2: no required module provides package golang.sigsum.org/sigsum-log-go/pkg/types; to add it:
+// go get golang.sigsum.org/sigsum-log-go/pkg/types
+// $ go get golang.sigsum.org/sigsum-log-go/pkg/types
+// go get: unrecognized import path "golang.sigsum.org/sigsum-log-go/pkg/types": https fetch: Get "https://golang.sigsum.org/sigsum-log-go/pkg/types?go-get=1": dial tcp: lookup golang.sigsum.org: no such host
+//
+// I.e., the above `go get` command should work with proper setup on our end.
+//
+// (If this is per-repo configuration in cgit -> need for sigsum-{lib,log}-go.)
+//
+
+import (
+ "fmt"
+ "golang.sigsum.org/sigsum-log-go/pkg/types"
+)
+
+func main() {
+ fmt.Printf("types.HashSize: %v\n", types.HashSize)
+}