diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index c617020..6552902 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -23,14 +23,14 @@ jobs: find . -name "go.mod" -execdir $(go env GOPATH)/bin/golangci-lint run --timeout=2m0s --out-format=checkstyle:golangci-lint-report.xml - --skip-dirs="internal/group/" \; + --skip-dirs="lib/group/" \; - name: Check golangci-lint report for errors run: find . -name "golangci-lint-report.xml" -exec grep "error" {} + && exit 1 || true - name: Upload golangci-lint report if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: golangci-lint-report path: | @@ -88,7 +88,7 @@ jobs: - name: Upload Go test reports if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: go-test-results path: | @@ -110,7 +110,7 @@ jobs: fetch-depth: 0 # fetch all history for all tags and branches to provide more metadata for sonar reports - name: Download all workflow run artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: Update golangci-lint report symlinks # When golangci-lint is run in a multimodule project, it creates a report with relative paths to the files which should be updated diff --git a/go/tdh2/internal/group/LICENSE b/go/tdh2/lib/group/LICENSE similarity index 100% rename from go/tdh2/internal/group/LICENSE rename to go/tdh2/lib/group/LICENSE diff --git a/go/tdh2/internal/group/group.go b/go/tdh2/lib/group/group.go similarity index 100% rename from go/tdh2/internal/group/group.go rename to go/tdh2/lib/group/group.go diff --git a/go/tdh2/internal/group/mod/int.go b/go/tdh2/lib/group/mod/int.go similarity index 99% rename from go/tdh2/internal/group/mod/int.go rename to go/tdh2/lib/group/mod/int.go index 8d6df45..63b0233 100644 --- a/go/tdh2/internal/group/mod/int.go +++ b/go/tdh2/lib/group/mod/int.go @@ -8,7 +8,7 @@ import ( "errors" "math/big" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group" ) // Int is a generic implementation of finite field arithmetic diff --git a/go/tdh2/internal/group/mod/int_test.go b/go/tdh2/lib/group/mod/int_test.go similarity index 100% rename from go/tdh2/internal/group/mod/int_test.go rename to go/tdh2/lib/group/mod/int_test.go diff --git a/go/tdh2/internal/group/nist/curve.go b/go/tdh2/lib/group/nist/curve.go similarity index 97% rename from go/tdh2/internal/group/nist/curve.go rename to go/tdh2/lib/group/nist/curve.go index c4726c6..9da4915 100644 --- a/go/tdh2/internal/group/nist/curve.go +++ b/go/tdh2/lib/group/nist/curve.go @@ -9,8 +9,8 @@ import ( "fmt" "math/big" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group/mod" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group/mod" ) // streamReader implements io.Reader from cipher.Stream diff --git a/go/tdh2/internal/group/nist/group_test.go b/go/tdh2/lib/group/nist/group_test.go similarity index 97% rename from go/tdh2/internal/group/nist/group_test.go rename to go/tdh2/lib/group/nist/group_test.go index 7f6485e..b47403b 100644 --- a/go/tdh2/internal/group/nist/group_test.go +++ b/go/tdh2/lib/group/nist/group_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group/test" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group/test" ) var benchmarks = []*test.GroupBench{ diff --git a/go/tdh2/internal/group/share/poly.go b/go/tdh2/lib/group/share/poly.go similarity index 98% rename from go/tdh2/internal/group/share/poly.go rename to go/tdh2/lib/group/share/poly.go index 474d2de..1a51d54 100644 --- a/go/tdh2/internal/group/share/poly.go +++ b/go/tdh2/lib/group/share/poly.go @@ -16,7 +16,7 @@ import ( "sort" "strings" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group" ) // PriShare represents a private share. diff --git a/go/tdh2/internal/group/share/poly_test.go b/go/tdh2/lib/group/share/poly_test.go similarity index 96% rename from go/tdh2/internal/group/share/poly_test.go rename to go/tdh2/lib/group/share/poly_test.go index a54e401..8a513f8 100644 --- a/go/tdh2/internal/group/share/poly_test.go +++ b/go/tdh2/lib/group/share/poly_test.go @@ -6,8 +6,8 @@ import ( "crypto/rand" "testing" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group/nist" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group/nist" ) var groups = []group.Group{ diff --git a/go/tdh2/internal/group/test/group.go b/go/tdh2/lib/group/test/group.go similarity index 98% rename from go/tdh2/internal/group/test/group.go rename to go/tdh2/lib/group/test/group.go index 52f8cf2..486e01c 100644 --- a/go/tdh2/internal/group/test/group.go +++ b/go/tdh2/lib/group/test/group.go @@ -1,7 +1,7 @@ package test import ( - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group" ) // GroupBench is a generic benchmark suite for group.groups. diff --git a/go/tdh2/internal/group/test/test.go b/go/tdh2/lib/group/test/test.go similarity index 99% rename from go/tdh2/internal/group/test/test.go rename to go/tdh2/lib/group/test/test.go index c25307e..bf7efc4 100644 --- a/go/tdh2/internal/group/test/test.go +++ b/go/tdh2/lib/group/test/test.go @@ -9,7 +9,7 @@ import ( "crypto/rand" "testing" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group" ) func testPointSet(t *testing.T, g group.Group, rand cipher.Stream) { diff --git a/go/tdh2/tdh2/tdh2.go b/go/tdh2/tdh2/tdh2.go index 7c31d98..c56e3d3 100644 --- a/go/tdh2/tdh2/tdh2.go +++ b/go/tdh2/tdh2/tdh2.go @@ -9,9 +9,9 @@ import ( "encoding/json" "fmt" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group/nist" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group/share" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group/nist" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group/share" ) var ( diff --git a/go/tdh2/tdh2/tdh2_test.go b/go/tdh2/tdh2/tdh2_test.go index f93e24b..8a5778c 100644 --- a/go/tdh2/tdh2/tdh2_test.go +++ b/go/tdh2/tdh2/tdh2_test.go @@ -14,8 +14,8 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group/nist" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group/nist" ) var supportedGroups = []string{ diff --git a/go/tdh2/tdh2easy/tdh2easy.go b/go/tdh2/tdh2easy/tdh2easy.go index e78e420..6fe61bb 100644 --- a/go/tdh2/tdh2easy/tdh2easy.go +++ b/go/tdh2/tdh2easy/tdh2easy.go @@ -8,7 +8,7 @@ import ( "encoding/json" "fmt" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group/nist" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group/nist" "github.com/smartcontractkit/tdh2/go/tdh2/tdh2" ) diff --git a/go/tdh2/tdh2easy/tdh2easy_test.go b/go/tdh2/tdh2easy/tdh2easy_test.go index 92bb6ac..c2507c4 100644 --- a/go/tdh2/tdh2easy/tdh2easy_test.go +++ b/go/tdh2/tdh2easy/tdh2easy_test.go @@ -8,7 +8,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/smartcontractkit/tdh2/go/tdh2/internal/group/nist" + "github.com/smartcontractkit/tdh2/go/tdh2/lib/group/nist" "github.com/smartcontractkit/tdh2/go/tdh2/tdh2" )