Skip to content

Commit

Permalink
Fix typos (#3048)
Browse files Browse the repository at this point in the history
  • Loading branch information
deining authored Jan 11, 2024
1 parent 207a38d commit e9f5269
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions example/newfilewithappauth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func main() {

itr, err := ghinstallation.NewAppsTransport(http.DefaultTransport, 10, privatePem)
if err != nil {
log.Fatalf("faild to create app transport: %v\n", err)
log.Fatalf("failed to create app transport: %v\n", err)
}
itr.BaseURL = gitHost

Expand All @@ -42,7 +42,7 @@ func main() {
).WithEnterpriseURLs(gitHost, gitHost)

if err != nil {
log.Fatalf("faild to create git client for app: %v\n", err)
log.Fatalf("failed to create git client for app: %v\n", err)
}

installations, _, err := client.Apps.ListInstallations(context.Background(), &github.ListOptions{})
Expand Down
4 changes: 2 additions & 2 deletions github/dependabot_alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"fmt"
)

// Dependency reprensents the vulnerable dependency.
// Dependency represents the vulnerable dependency.
type Dependency struct {
Package *VulnerabilityPackage `json:"package,omitempty"`
ManifestPath *string `json:"manifest_path,omitempty"`
Expand All @@ -23,7 +23,7 @@ type AdvisoryCVSS struct {
VectorString *string `json:"vector_string,omitempty"`
}

// AdvisoryCWEs reprensent the advisory pertaining to Common Weakness Enumeration.
// AdvisoryCWEs represent the advisory pertaining to Common Weakness Enumeration.
type AdvisoryCWEs struct {
CWEID *string `json:"cwe_id,omitempty"`
Name *string `json:"name,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion github/event_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,7 @@ type ReleaseEvent struct {

// RepositoryEvent is triggered when a repository is created, archived, unarchived,
// renamed, edited, transferred, made public, or made private. Organization hooks are
// also trigerred when a repository is deleted.
// also triggered when a repository is deleted.
// The Webhook event name is "repository".
//
// Events of this type are not visible in timelines, they are only used to
Expand Down
2 changes: 1 addition & 1 deletion github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro
// JSON decoded and stored in the value pointed to by v, or returned as an
// error if an API error has occurred. If v implements the io.Writer interface,
// the raw response body will be written to v, without attempting to first
// decode it. If v is nil, and no error hapens, the response is returned as is.
// decode it. If v is nil, and no error happens, the response is returned as is.
// If rate limit is exceeded and reset time is in the future, Do returns
// *RateLimitError immediately without making a network API call.
//
Expand Down
2 changes: 1 addition & 1 deletion github/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestStringify(t *testing.T) {
}

// Directly test the String() methods on various GitHub types. We don't do an
// exaustive test of all the various field types, since TestStringify() above
// exhaustive test of all the various field types, since TestStringify() above
// takes care of that. Rather, we just make sure that Stringify() is being
// used to build the strings, which we do by verifying that pointers are
// stringified as their underlying value.
Expand Down
4 changes: 2 additions & 2 deletions github/teams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ func TestTeamsService_AddTeamRepoByID_noAccess(t *testing.T) {
ctx := context.Background()
_, err := client.Teams.AddTeamRepoByID(ctx, 1, 1, "owner", "repo", nil)
if err == nil {
t.Errorf("Expcted error to be returned")
t.Errorf("Expected error to be returned")
}
}

Expand All @@ -888,7 +888,7 @@ func TestTeamsService_AddTeamRepoBySlug_noAccess(t *testing.T) {
ctx := context.Background()
_, err := client.Teams.AddTeamRepoBySlug(ctx, "org", "slug", "owner", "repo", nil)
if err == nil {
t.Errorf("Expcted error to be returned")
t.Errorf("Expected error to be returned")
}
}

Expand Down
1 change: 1 addition & 0 deletions tools/metadata/testdata/update-go/invalid/github/a.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func (*AService) Ambiguous() {}
func (*AService) MissingOperation() {}

// DuplicateOperations has duplicate operations
//
//meta:operation GET /a/{a_id}
//meta:operation POST /a/{a_id}
//meta:operation GET /a/{a_id}
Expand Down
2 changes: 2 additions & 0 deletions tools/metadata/testdata/update-go/valid/github/a.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ package github
type AService struct{}

// Get gets an A
//
//meta:operation GET /a/{non-canonical-id}
func (s *AService) Get() {}

// Undocumented uses an undocumented operation
//
//meta:operation GET /undocumented/{undocumented_id}
func (s *AService) Undocumented() {}

Expand Down

0 comments on commit e9f5269

Please sign in to comment.