You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
800B

  1. package main
  2. import (
  3. "log"
  4. "net/http"
  5. )
  6. func convert2DsliceTo1D(sliceTwoDim [][]string) []string {
  7. var returnSlice []string
  8. for _, element := range sliceTwoDim {
  9. returnSlice = append(returnSlice, element[1]) // ignore
  10. }
  11. return returnSlice
  12. }
  13. func doStuff(cookie *http.Cookie) {
  14. log.Println("Entering giveaways...")
  15. enterGiveaways(cookie, true)
  16. enterGiveaways(cookie, false)
  17. log.Println("Sleeping for " + timeToSleepFor.String())
  18. }
  19. func removeDuplicatesUnordered(elements []string) []string {
  20. encountered := map[string]bool{}
  21. // Create a map of all unique elements.
  22. for v := range elements {
  23. encountered[elements[v]] = true
  24. }
  25. // Place all keys from the map into a slice.
  26. result := []string{}
  27. for key := range encountered {
  28. result = append(result, key)
  29. }
  30. return result
  31. }