You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: soft_palettegen.go
    path of file: ./repos/lazygit/vendor/github.com/lucasb-eyer/go-colorful
    
    the code of the file until where you have to start completion: // Largely inspired by the descriptions in http://lab.medialab.sciences-po.fr/iwanthue/
// but written from
    
func in(haystack []lab_t, upto int, needle lab_t) bool {
	for i := 0; i < upto && i < len(haystack); i++ {
		if haystack[i] == needle {
			return true
		}
	}
	return false
}