From 272a5748e462ed792040da081e1dbdf76958ca0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Sza=C5=82achowski?= Date: Mon, 23 Jun 2025 10:55:13 +0200 Subject: [PATCH 1/3] internal/group -> lib/group --- go/tdh2/{internal => lib}/group/LICENSE | 0 go/tdh2/{internal => lib}/group/group.go | 0 go/tdh2/{internal => lib}/group/mod/int.go | 2 +- go/tdh2/{internal => lib}/group/mod/int_test.go | 0 go/tdh2/{internal => lib}/group/nist/curve.go | 4 ++-- go/tdh2/{internal => lib}/group/nist/group_test.go | 4 ++-- go/tdh2/{internal => lib}/group/share/poly.go | 2 +- go/tdh2/{internal => lib}/group/share/poly_test.go | 4 ++-- go/tdh2/{internal => lib}/group/test/group.go | 2 +- go/tdh2/{internal => lib}/group/test/test.go | 2 +- go/tdh2/tdh2/tdh2.go | 6 +++--- go/tdh2/tdh2/tdh2_test.go | 4 ++-- go/tdh2/tdh2easy/tdh2easy.go | 2 +- go/tdh2/tdh2easy/tdh2easy_test.go | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) rename go/tdh2/{internal => lib}/group/LICENSE (100%) rename go/tdh2/{internal => lib}/group/group.go (100%) rename go/tdh2/{internal => lib}/group/mod/int.go (99%) rename go/tdh2/{internal => lib}/group/mod/int_test.go (100%) rename go/tdh2/{internal => lib}/group/nist/curve.go (97%) rename go/tdh2/{internal => lib}/group/nist/group_test.go (97%) rename go/tdh2/{internal => lib}/group/share/poly.go (98%) rename go/tdh2/{internal => lib}/group/share/poly_test.go (96%) rename go/tdh2/{internal => lib}/group/test/group.go (98%) rename go/tdh2/{internal => lib}/group/test/test.go (99%) 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" ) From 2f89fe2fdcbb080ece0ce2563f289d938566faa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Sza=C5=82achowski?= Date: Mon, 23 Jun 2025 11:54:45 +0200 Subject: [PATCH 2/3] bump deprecated actions/upload-artifact and actions/download-artifact --- .github/workflows/go.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index c617020..36cd55e 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -30,7 +30,7 @@ jobs: - 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 From a39db8d4593ed865a1a0bd05af03e04bd45b520b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Sza=C5=82achowski?= Date: Tue, 24 Jun 2025 16:58:24 +0200 Subject: [PATCH 3/3] fix golangci skip-dirs --- .github/workflows/go.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 36cd55e..6552902 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -23,7 +23,7 @@ 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