Repository: google/go-github
File: github/classroom.go (Go)

Code before:

// GetAssignment gets a GitHub Classroom assignment. Assignment will only be
// returned if the current user is an administrator of the GitHub Classroom
// for the assignment.
//
// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-an-assignment
//
//meta:operation GET /assignments/{assignment_id}
func (s *ClassroomService) GetAssignment(ctx context.Context, assignmentID int64) (*ClassroomAssignment, *Response, error) {
	u := fmt.Sprintf("assignments/%v", assignmentID)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	assignment := new(ClassroomAssignment)
	resp, err := s.client.Do(ctx, req, assignment)
	if err != nil {
		return nil, resp, err
	}

	return assignment, resp, nil
}

// GetClassroom gets a GitHub Classroom classroom for the current user. Classroom will only be
// returned if the current user is an administrator of the GitHub Classroom.
//
// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-a-classroom
//
//meta:operation GET /classrooms/{classroom_id}
func (s *ClassroomService) GetClassroom(ctx context.Context, classroomID int64) (*Classroom, *Response, error) {
	u := fmt.Sprintf("classrooms/%v", classroomID)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	classroom := new(Classroom)
	resp, err := s.client.Do(ctx, req, classroom)
	if err != nil {
		return nil, resp, err
	}

	return classroom, resp, nil
}

// ListClassrooms lists GitHub Classroom classrooms for the current user. Classrooms will only be
// returned if the current user is an administrator of one or more GitHub Classrooms.
//

Review comment (suggestion):
```suggestion
// GetClassroom gets a GitHub Classroom for the current user. Classroom will only be
```

Code after:

// GetAssignment gets a GitHub Classroom assignment. Assignment will only be
// returned if the current user is an administrator of the GitHub Classroom
// for the assignment.
//
// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-an-assignment
//
//meta:operation GET /assignments/{assignment_id}
func (s *ClassroomService) GetAssignment(ctx context.Context, assignmentID int64) (*ClassroomAssignment, *Response, error) {
	u := fmt.Sprintf("assignments/%v", assignmentID)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	assignment := new(ClassroomAssignment)
	resp, err := s.client.Do(ctx, req, assignment)
	if err != nil {
		return nil, resp, err
	}

	return assignment, resp, nil
}

// GetClassroom gets a GitHub Classroom for the current user. Classroom will only be
// returned if the current user is an administrator of the GitHub Classroom.
//
// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-a-classroom
//
//meta:operation GET /classrooms/{classroom_id}
func (s *ClassroomService) GetClassroom(ctx context.Context, classroomID int64) (*Classroom, *Response, error) {
	u := fmt.Sprintf("classrooms/%v", classroomID)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	classroom := new(Classroom)
	resp, err := s.client.Do(ctx, req, classroom)
	if err != nil {
		return nil, resp, err
	}

	return classroom, resp, nil
}

// ListClassrooms lists GitHub Classrooms for the current user. Classrooms will only be
// returned if the current user is an administrator of one or more GitHub Classrooms.
//