/* * Copyright (c) 2016-2017, Randy Westlund. All rights reserved. * This code is under the BSD-2-Clause license. * * This file contains general utility functions. */ package main // Return true if the first arg slice contains the second arg. func contains(haystack []string, needle string) bool { for _, v := range haystack { if v == needle { return true } } return false }