Skip to content

Commit

Permalink
Merge pull request #15 from keybase/joshblum/go-1.23-upgrade
Browse files Browse the repository at this point in the history
Upgrade to go 1.23
  • Loading branch information
joshblum authored Jan 7, 2025
2 parents f941b05 + d6d2627 commit 3d8f9f2
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.19.x, 1.20.x, 1.21.x]
go-version: [1.21.x, 1.22.x, 1.23.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -21,6 +21,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55
version: v1.63
- run: go vet ./...
- run: go test ./...
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ linters:
- gofmt
- gocritic
- unconvert
- revive
- govet
2 changes: 1 addition & 1 deletion bitslice.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"encoding/binary"
Expand Down
2 changes: 1 addition & 1 deletion bitslice_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"encoding/binary"
Expand Down
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Package merkleTree is a generic Merkle Tree implementation, for provably publishing lots
Package merkletree is a generic Merkle Tree implementation, for provably publishing lots
of data under one succinct tree root.
Install:
Expand Down Expand Up @@ -51,4 +51,4 @@ To construct a new Tree from scratch, you need to specify three parameters:
- An array of KeyValuePairs, the things actually stored in the Merkle tree.
*/
package merkleTree
package merkletree
2 changes: 1 addition & 1 deletion errors.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"errors"
Expand Down
16 changes: 8 additions & 8 deletions example_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package merkleTree_test
package merkletree_test

import (
"golang.org/x/net/context"

merkleTree "github.com/keybase/go-merkle-tree"
merkletree "github.com/keybase/go-merkle-tree"
)

func ExampleTree_Build() {
Expand All @@ -12,27 +12,27 @@ func ExampleTree_Build() {
// of phony objects. Importantly, it fits the 'ValueConstructor'
// interface, so that it can tell the MerkleTree class how
// to pull type values out of the tree.
factory := merkleTree.NewTestObjFactory()
factory := merkletree.NewTestObjFactory()

// Make a whole bunch of phony objects in our Object Factory.
objs := factory.Mproduce(1024)

// Collect and sort the objects into a "sorted map"
sm := merkleTree.NewSortedMapFromList(objs)
sm := merkletree.NewSortedMapFromList(objs)

// Make a test storage engine
eng := merkleTree.NewMemEngine()
eng := merkletree.NewMemEngine()

// 256 children per node; once there are 512 entries in a leaf,
// then split the leaf by adding more parents.
config := merkleTree.NewConfig(merkleTree.SHA512Hasher{}, 256, 512, factory)
config := merkletree.NewConfig(merkletree.SHA512Hasher{}, 256, 512, factory)

// Make a new tree object with this engine and these config
// values
tree := merkleTree.NewTree(eng, config)
tree := merkletree.NewTree(eng, config)

// Make an empty Tranaction info for now
var txInfo merkleTree.TxInfo
var txInfo merkletree.TxInfo

// Build the tree
err := tree.Build(context.TODO(), sm, txInfo)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/keybase/go-merkle-tree

go 1.19
go 1.21

require (
github.com/keybase/go-codec v0.0.0-20180928230036-164397562123
golang.org/x/net v0.19.0
golang.org/x/net v0.34.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/keybase/go-codec v0.0.0-20180928230036-164397562123 h1:yg56lYPqh9suJepqxOMd/liFgU/x+maRPiB30JNYykM=
github.com/keybase/go-codec v0.0.0-20180928230036-164397562123/go.mod h1:r/eVVWCngg6TsFV/3HuS9sWhDkAzGG8mXhiuYA+Z/20=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
2 changes: 1 addition & 1 deletion hash.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"crypto/sha512"
Expand Down
2 changes: 1 addition & 1 deletion hash_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import "testing"

Expand Down
2 changes: 1 addition & 1 deletion inode.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

type childPointerMap struct {
tab []Hash
Expand Down
2 changes: 1 addition & 1 deletion interfaces.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import "golang.org/x/net/context"

Expand Down
4 changes: 2 additions & 2 deletions mem.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"crypto/sha512"
Expand All @@ -23,7 +23,7 @@ func NewMemEngine() *MemEngine {
var _ StorageEngine = (*MemEngine)(nil)

// CommitRoot "commits" the root ot the blessed memory slot
func (m *MemEngine) CommitRoot(_ context.Context, prev Hash, curr Hash, txinfo TxInfo) error {
func (m *MemEngine) CommitRoot(_ context.Context, _ Hash, curr Hash, _ TxInfo) error {
m.root = curr
return nil
}
Expand Down
3 changes: 2 additions & 1 deletion msgpack.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package merkleTree
package merkletree

import (
"bytes"

"github.com/keybase/go-codec/codec"
)

Expand Down
2 changes: 1 addition & 1 deletion node.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"encoding/hex"
Expand Down
2 changes: 1 addition & 1 deletion obj_factory_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"crypto/rand"
Expand Down
2 changes: 1 addition & 1 deletion sorted_map.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"sort"
Expand Down
2 changes: 1 addition & 1 deletion tree.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"sync"
Expand Down
2 changes: 1 addition & 1 deletion tree_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package merkleTree
package merkletree

// Hash is a byte-array, used to represent a full collision-resistant hash.
type Hash []byte
Expand Down

0 comments on commit 3d8f9f2

Please sign in to comment.