Skip to content

Commit 7eaac19

Browse files
Update challenge-3/submissions/shansing/solution-template.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent b3a7852 commit 7eaac19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

challenge-3/submissions/shansing/solution-template.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ func (m *Manager) GetAverageSalary() float64 {
4242

4343
// FindEmployeeByID finds and returns an employee by their ID.
4444
func (m *Manager) FindEmployeeByID(id int) *Employee {
45-
for _, employee := range m.Employees {
46-
if employee.ID == id {
47-
return &employee
45+
for i := range m.Employees {
46+
if m.Employees[i].ID == id {
47+
return &m.Employees[i]
4848
}
4949
}
5050
return nil

0 commit comments

Comments
 (0)