Skip to content

Instantly share code, notes, and snippets.

@mottet-dev
Created July 8, 2019 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mottet-dev/db2d8886f0b601e8838470e868f6b975 to your computer and use it in GitHub Desktop.
Save mottet-dev/db2d8886f0b601e8838470e868f6b975 to your computer and use it in GitHub Desktop.
Go test
package helpers
import "testing"
func TestDoesSliceIncludesInt(t *testing.T) {
inputValue := 3
inputSlice := []int{1, 2, 3}
expectedOutput := true
got := DoesSliceIncludesInt(inputValue, inputSlice)
if got != expectedOutput {
t.Errorf("SliceIncludesInt(%d, %d) = %t; want %t", inputValue, inputSlice, got, expectedOutput)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment