daily pastebin goal
60%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. type Weekday int
  6.  
  7. const (
  8.     Sunday Weekday = iota
  9.     Monday
  10.     Tuesday
  11.     Wednesday
  12.     Thursday
  13.     Friday
  14.     Saturday
  15. )
  16.  
  17. func (e Weekday) String() string {
  18.     names := [...]string{
  19.         "sunday",
  20.         "monday",
  21.         "tuesday",
  22.         "wednesday",
  23.         "thursday",
  24.         "friday",
  25.         "saturday",
  26.     }
  27.     return names[e]
  28. }
  29.  
  30. func main() {
  31.     fmt.Printf("monday = %+v\n", Monday)
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top