From c2ccecb26cce922887978356343d63447d986224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= <484633+joaodrp@users.noreply.github.com> Date: Sat, 5 Sep 2026 19:42:37 +0100 Subject: [PATCH] fix(build): declare the module path as the repository URL go.mod declares `module ghealth`, so the module cannot be resolved by the path it is fetched from: $ go install github.com/Google-Health-API/google-health-cli@latest module declares its path as: ghealth but was required as: github.com/Google-Health-API/google-health-cli That blocks `go install` and the version managers built on it, which is why the README has to say clone and build. It also leaves everything under `pkg/` unimportable, despite the layout announcing those packages as public. Set the module path to the repository URL and update the imports that follow from it. No behaviour change. --- cmd/auth.go | 6 +++--- cmd/config_cmd.go | 4 ++-- cmd/data.go | 6 +++--- cmd/data_civil_zone_test.go | 2 +- cmd/data_ecg_test.go | 2 +- cmd/data_filter_test.go | 2 +- cmd/data_localday_test.go | 2 +- cmd/data_range_cap_test.go | 4 ++-- cmd/data_timezone_test.go | 2 +- cmd/root.go | 8 ++++---- cmd/schema.go | 8 ++++---- cmd/schema_params_test.go | 2 +- cmd/setup.go | 6 +++--- cmd/timezone.go | 2 +- cmd/user.go | 4 ++-- cmd/webhooks.go | 6 +++--- go.mod | 2 +- main.go | 2 +- pkg/auth/auth.go | 2 +- pkg/client/client.go | 8 ++++---- pkg/schema/discovery.go | 2 +- 21 files changed, 41 insertions(+), 41 deletions(-) diff --git a/cmd/auth.go b/cmd/auth.go index f66522c..a93569c 100644 --- a/cmd/auth.go +++ b/cmd/auth.go @@ -24,9 +24,9 @@ import ( "strings" "time" - "ghealth/pkg/auth" - "ghealth/pkg/client" - "ghealth/pkg/config" + "github.com/Google-Health-API/google-health-cli/pkg/auth" + "github.com/Google-Health-API/google-health-cli/pkg/client" + "github.com/Google-Health-API/google-health-cli/pkg/config" "github.com/spf13/cobra" "golang.org/x/oauth2" ) diff --git a/cmd/config_cmd.go b/cmd/config_cmd.go index db417c3..f077cbf 100644 --- a/cmd/config_cmd.go +++ b/cmd/config_cmd.go @@ -22,9 +22,9 @@ import ( "strings" "time" - "ghealth/pkg/client" - "ghealth/pkg/config" "github.com/BurntSushi/toml" + "github.com/Google-Health-API/google-health-cli/pkg/client" + "github.com/Google-Health-API/google-health-cli/pkg/config" "github.com/spf13/cobra" ) diff --git a/cmd/data.go b/cmd/data.go index 114ecc2..306eb11 100644 --- a/cmd/data.go +++ b/cmd/data.go @@ -24,9 +24,9 @@ import ( "strings" "time" - "ghealth/pkg/client" - "ghealth/pkg/output" - "ghealth/pkg/types" + "github.com/Google-Health-API/google-health-cli/pkg/client" + "github.com/Google-Health-API/google-health-cli/pkg/output" + "github.com/Google-Health-API/google-health-cli/pkg/types" "github.com/spf13/cobra" ) diff --git a/cmd/data_civil_zone_test.go b/cmd/data_civil_zone_test.go index 3ac86df..1c8629d 100644 --- a/cmd/data_civil_zone_test.go +++ b/cmd/data_civil_zone_test.go @@ -17,7 +17,7 @@ package cmd import ( "testing" - "ghealth/pkg/types" + "github.com/Google-Health-API/google-health-cli/pkg/types" ) // Civil filter fields (interval civil_start_time, sleep civil_end_time) do diff --git a/cmd/data_ecg_test.go b/cmd/data_ecg_test.go index bb735cd..90de79e 100644 --- a/cmd/data_ecg_test.go +++ b/cmd/data_ecg_test.go @@ -18,7 +18,7 @@ import ( "strings" "testing" - "ghealth/pkg/types" + "github.com/Google-Health-API/google-health-cli/pkg/types" ) // buildFilter for ECG must produce a physical start_time lower-bound filter and diff --git a/cmd/data_filter_test.go b/cmd/data_filter_test.go index f64b804..cd4df77 100644 --- a/cmd/data_filter_test.go +++ b/cmd/data_filter_test.go @@ -18,7 +18,7 @@ import ( "strings" "testing" - "ghealth/pkg/types" + "github.com/Google-Health-API/google-health-cli/pkg/types" ) func TestParseEndDate(t *testing.T) { diff --git a/cmd/data_localday_test.go b/cmd/data_localday_test.go index a3fce08..c2a858f 100644 --- a/cmd/data_localday_test.go +++ b/cmd/data_localday_test.go @@ -17,7 +17,7 @@ package cmd import ( "testing" - "ghealth/pkg/types" + "github.com/Google-Health-API/google-health-cli/pkg/types" ) // At a +02:00 host, a bare date on a physical-time (sample) field must anchor at diff --git a/cmd/data_range_cap_test.go b/cmd/data_range_cap_test.go index 34a9590..654285e 100644 --- a/cmd/data_range_cap_test.go +++ b/cmd/data_range_cap_test.go @@ -18,8 +18,8 @@ import ( "strings" "testing" - "ghealth/pkg/client" - "ghealth/pkg/types" + "github.com/Google-Health-API/google-health-cli/pkg/client" + "github.com/Google-Health-API/google-health-cli/pkg/types" ) func TestRollupRangeCapDays_Registry(t *testing.T) { diff --git a/cmd/data_timezone_test.go b/cmd/data_timezone_test.go index 64ba37b..bc198a0 100644 --- a/cmd/data_timezone_test.go +++ b/cmd/data_timezone_test.go @@ -20,7 +20,7 @@ import ( "testing" "time" - "ghealth/pkg/types" + "github.com/Google-Health-API/google-health-cli/pkg/types" ) func writeTimezoneConfig(t *testing.T, dir, tz string) { diff --git a/cmd/root.go b/cmd/root.go index 00e2b58..5a7e5c8 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,10 +15,10 @@ package cmd import ( - "ghealth/internal/version" - "ghealth/pkg/auth" - "ghealth/pkg/client" - configPkg "ghealth/pkg/config" + "github.com/Google-Health-API/google-health-cli/internal/version" + "github.com/Google-Health-API/google-health-cli/pkg/auth" + "github.com/Google-Health-API/google-health-cli/pkg/client" + configPkg "github.com/Google-Health-API/google-health-cli/pkg/config" "github.com/spf13/cobra" ) diff --git a/cmd/schema.go b/cmd/schema.go index 399324f..857a514 100644 --- a/cmd/schema.go +++ b/cmd/schema.go @@ -20,10 +20,10 @@ import ( "sort" "strings" - "ghealth/pkg/auth" - "ghealth/pkg/client" - "ghealth/pkg/schema" - "ghealth/pkg/types" + "github.com/Google-Health-API/google-health-cli/pkg/auth" + "github.com/Google-Health-API/google-health-cli/pkg/client" + "github.com/Google-Health-API/google-health-cli/pkg/schema" + "github.com/Google-Health-API/google-health-cli/pkg/types" "github.com/spf13/cobra" ) diff --git a/cmd/schema_params_test.go b/cmd/schema_params_test.go index 29e2785..294341a 100644 --- a/cmd/schema_params_test.go +++ b/cmd/schema_params_test.go @@ -17,7 +17,7 @@ package cmd import ( "testing" - "ghealth/pkg/types" + "github.com/Google-Health-API/google-health-cli/pkg/types" ) // schema type must describe the API's real parameters, never the diff --git a/cmd/setup.go b/cmd/setup.go index 3200af8..e0aaa69 100644 --- a/cmd/setup.go +++ b/cmd/setup.go @@ -23,9 +23,9 @@ import ( "path/filepath" "strings" - "ghealth/pkg/auth" - "ghealth/pkg/client" - "ghealth/pkg/config" + "github.com/Google-Health-API/google-health-cli/pkg/auth" + "github.com/Google-Health-API/google-health-cli/pkg/client" + "github.com/Google-Health-API/google-health-cli/pkg/config" "github.com/spf13/cobra" ) diff --git a/cmd/timezone.go b/cmd/timezone.go index fb61697..c2eb1ba 100644 --- a/cmd/timezone.go +++ b/cmd/timezone.go @@ -20,7 +20,7 @@ import ( "sync" "time" - "ghealth/pkg/config" + "github.com/Google-Health-API/google-health-cli/pkg/config" ) var ( diff --git a/cmd/user.go b/cmd/user.go index e6a1f8e..acda652 100644 --- a/cmd/user.go +++ b/cmd/user.go @@ -17,8 +17,8 @@ package cmd import ( "encoding/json" - "ghealth/pkg/client" - "ghealth/pkg/output" + "github.com/Google-Health-API/google-health-cli/pkg/client" + "github.com/Google-Health-API/google-health-cli/pkg/output" "github.com/spf13/cobra" ) diff --git a/cmd/webhooks.go b/cmd/webhooks.go index f9761fc..3a40bcd 100644 --- a/cmd/webhooks.go +++ b/cmd/webhooks.go @@ -22,9 +22,9 @@ import ( "strings" "time" - "ghealth/pkg/client" - configPkg "ghealth/pkg/config" - "ghealth/pkg/output" + "github.com/Google-Health-API/google-health-cli/pkg/client" + configPkg "github.com/Google-Health-API/google-health-cli/pkg/config" + "github.com/Google-Health-API/google-health-cli/pkg/output" "github.com/spf13/cobra" ) diff --git a/go.mod b/go.mod index 123f085..eafff3b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module ghealth +module github.com/Google-Health-API/google-health-cli go 1.23.0 diff --git a/main.go b/main.go index 5cb3620..dab157b 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,7 @@ package main import ( "os" - "ghealth/cmd" + "github.com/Google-Health-API/google-health-cli/cmd" ) func main() { diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go index eb399cd..4d86530 100644 --- a/pkg/auth/auth.go +++ b/pkg/auth/auth.go @@ -33,7 +33,7 @@ import ( "sync" "time" - "ghealth/pkg/config" + "github.com/Google-Health-API/google-health-cli/pkg/config" "golang.org/x/oauth2" "golang.org/x/oauth2/google" ) diff --git a/pkg/client/client.go b/pkg/client/client.go index 906c5e6..c74e92e 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -27,8 +27,8 @@ import ( "strings" "time" - "ghealth/internal/version" - "ghealth/pkg/auth" + "github.com/Google-Health-API/google-health-cli/internal/version" + "github.com/Google-Health-API/google-health-cli/pkg/auth" ) const MaxRetries = 3 @@ -229,7 +229,7 @@ func (c *Client) doOnce(req *Request) (*Response, error) { return nil, &AuthError{Err: err} } httpReq.Header.Set("Authorization", "Bearer "+token) - httpReq.Header.Set("x-goog-api-client", "ghealth/"+version.Version) + httpReq.Header.Set("x-goog-api-client", "github.com/Google-Health-API/google-health-cli/"+version.Version) if req.ContentType != "" { httpReq.Header.Set("Content-Type", req.ContentType) @@ -272,7 +272,7 @@ func (c *Client) DryRun(req *Request) (json.RawMessage, error) { "url": fullURL, "headers": map[string]string{ "Authorization": "Bearer [REDACTED]", - "x-goog-api-client": "ghealth/" + version.Version, + "x-goog-api-client": "github.com/Google-Health-API/google-health-cli/" + version.Version, "Content-Type": "application/json", }, } diff --git a/pkg/schema/discovery.go b/pkg/schema/discovery.go index 6aac2c5..7f0e301 100644 --- a/pkg/schema/discovery.go +++ b/pkg/schema/discovery.go @@ -23,7 +23,7 @@ import ( "path/filepath" "time" - "ghealth/pkg/config" + "github.com/Google-Health-API/google-health-cli/pkg/config" ) const (