From fdb2be15d51ffd2028fc3ba5381284a2a7f40754 Mon Sep 17 00:00:00 2001 From: be0x74a Date: Sat, 19 Aug 2023 15:02:22 +0100 Subject: [PATCH] Address linter errors --- github/dependency_graph_snapshots.go | 4 ++-- github/dependency_graph_snapshots_test.go | 8 ++++---- github/github-accessors.go | 16 ++++++++-------- github/github-accessors_test.go | 20 ++++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/github/dependency_graph_snapshots.go b/github/dependency_graph_snapshots.go index b494e86c422..0aec48a6ded 100644 --- a/github/dependency_graph_snapshots.go +++ b/github/dependency_graph_snapshots.go @@ -33,7 +33,7 @@ type DependencyGraphSnapshotResolvedDependencyScope string type DependencyGraphSnapshotCreationResult string type DependencyGraphSnapshotResolvedDependency struct { - PackageUrl *string `json:"package_url,omitempty"` + PackageURL *string `json:"package_url,omitempty"` Relationship DependencyGraphSnapshotResolvedDependencyRelationship `json:"relationship,omitempty"` Scope DependencyGraphSnapshotResolvedDependencyScope `json:"scope,omitempty"` Dependencies []string `json:"dependencies,omitempty"` @@ -42,7 +42,7 @@ type DependencyGraphSnapshotResolvedDependency struct { type DependencyGraphSnapshotJob struct { Correlator *string `json:"correlator,omitempty"` ID *string `json:"id,omitempty"` - HtmlUrl *string `json:"html_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` } type DependencyGraphSnapshotDetector struct { diff --git a/github/dependency_graph_snapshots_test.go b/github/dependency_graph_snapshots_test.go index bff901d53fe..c9a2cc8345a 100644 --- a/github/dependency_graph_snapshots_test.go +++ b/github/dependency_graph_snapshots_test.go @@ -33,7 +33,7 @@ func TestDependencyGraphService_CreateSnapshot(t *testing.T) { Job: &DependencyGraphSnapshotJob{ Correlator: String("yourworkflowname_youractionname"), ID: String("yourrunid"), - HtmlUrl: String("https://example.com"), + HTMLURL: String("https://example.com"), }, Detector: &DependencyGraphSnapshotDetector{ Name: String("octo-detector"), @@ -47,19 +47,19 @@ func TestDependencyGraphService_CreateSnapshot(t *testing.T) { File: &DependencyGraphSnapshotManifestFile{SourceLocation: String("src/package-lock.json")}, Resolved: map[string]*DependencyGraphSnapshotResolvedDependency{ "@actions/core": { - PackageUrl: String("pkg:/npm/%40actions/core@1.1.9"), + PackageURL: String("pkg:/npm/%40actions/core@1.1.9"), Relationship: "direct", Scope: "runtime", Dependencies: []string{"@actions/http-client"}, }, "@actions/http-client": { - PackageUrl: String("pkg:/npm/%40actions/http-client@1.0.7"), + PackageURL: String("pkg:/npm/%40actions/http-client@1.0.7"), Relationship: "indirect", Scope: "runtime", Dependencies: []string{"tunnel"}, }, "tunnel": { - PackageUrl: String("pkg:/npm/tunnel@0.0.6"), + PackageURL: String("pkg:/npm/tunnel@0.0.6"), Relationship: "indirect", Scope: "runtime", }, diff --git a/github/github-accessors.go b/github/github-accessors.go index edbc048af3f..6acb5b3150a 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5294,12 +5294,12 @@ func (d *DependencyGraphSnapshotJob) GetCorrelator() string { return *d.Correlator } -// GetHtmlUrl returns the HtmlUrl field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotJob) GetHtmlUrl() string { - if d == nil || d.HtmlUrl == nil { +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotJob) GetHTMLURL() string { + if d == nil || d.HTMLURL == nil { return "" } - return *d.HtmlUrl + return *d.HTMLURL } // GetID returns the ID field if it's non-nil, zero value otherwise. @@ -5334,12 +5334,12 @@ func (d *DependencyGraphSnapshotManifestFile) GetSourceLocation() string { return *d.SourceLocation } -// GetPackageUrl returns the PackageUrl field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotResolvedDependency) GetPackageUrl() string { - if d == nil || d.PackageUrl == nil { +// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetPackageURL() string { + if d == nil || d.PackageURL == nil { return "" } - return *d.PackageUrl + return *d.PackageURL } // GetAction returns the Action field if it's non-nil, zero value otherwise. diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 0def0a42343..f861002ab95 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6216,14 +6216,14 @@ func TestDependencyGraphSnapshotJob_GetCorrelator(tt *testing.T) { d.GetCorrelator() } -func TestDependencyGraphSnapshotJob_GetHtmlUrl(tt *testing.T) { +func TestDependencyGraphSnapshotJob_GetHTMLURL(tt *testing.T) { var zeroValue string - d := &DependencyGraphSnapshotJob{HtmlUrl: &zeroValue} - d.GetHtmlUrl() + d := &DependencyGraphSnapshotJob{HTMLURL: &zeroValue} + d.GetHTMLURL() d = &DependencyGraphSnapshotJob{} - d.GetHtmlUrl() + d.GetHTMLURL() d = nil - d.GetHtmlUrl() + d.GetHTMLURL() } func TestDependencyGraphSnapshotJob_GetID(tt *testing.T) { @@ -6263,14 +6263,14 @@ func TestDependencyGraphSnapshotManifestFile_GetSourceLocation(tt *testing.T) { d.GetSourceLocation() } -func TestDependencyGraphSnapshotResolvedDependency_GetPackageUrl(tt *testing.T) { +func TestDependencyGraphSnapshotResolvedDependency_GetPackageURL(tt *testing.T) { var zeroValue string - d := &DependencyGraphSnapshotResolvedDependency{PackageUrl: &zeroValue} - d.GetPackageUrl() + d := &DependencyGraphSnapshotResolvedDependency{PackageURL: &zeroValue} + d.GetPackageURL() d = &DependencyGraphSnapshotResolvedDependency{} - d.GetPackageUrl() + d.GetPackageURL() d = nil - d.GetPackageUrl() + d.GetPackageURL() } func TestDeployKeyEvent_GetAction(tt *testing.T) {