Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Last active August 6, 2021 11:39
Show Gist options
  • Save percybolmer/e1b246b3d27a6c6d32d6def522e288d5 to your computer and use it in GitHub Desktop.
Save percybolmer/e1b246b3d27a6c6d32d6def522e288d5 to your computer and use it in GitHub Desktop.
// insertXIntSlice is used to add X amount of items into a []int
func insertXIntSlice(x int, b *testing.B) {
// Initalize a Slice and insert X amount of Items
testSlice := make([]int, 0)
// reset timer
b.ResetTimer()
for i := 0; i < x; i++ {
testSlice = append(testSlice, i)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment