[Solved] Index slice within Main func when using setGrade()


There’s no built-in method what you’re looking for (merging slices). However, you can use append method like:

s.setGrade(append([]int{80}, s.Grade[1:]...))

If you had to update two grade ints then you could have done:

s.setGrade(append([]int{80,95}, s.Grade[2:]...))

1

solved Index slice within Main func when using setGrade()