switch, time.Sleep



package main

import(
    "fmt"
    "time"
)

func main() {
    fmt.Println("When's Saturday?")
    today := time.Now().Weekday()

    switch time.Saturday {
    case today+0:
        fmt.Println("Today")
    case today+1:
        fmt.Println("Tomorrow")
    case today+2:
        fmt.Println("In two days")
    default:
        fmt.Println("Too far away")
    }
    time.Sleep(3000 * time.Millisecond)
    fmt.Println("Just woke up")
}

15 comments:

  1. The images around your entries are rather distracting and entirely unrelated to the matter at hand. I would prefer that you remove them.

    ReplyDelete
  2. Thanks for the code, I'm 100% with Michael. The images are a problem, actually.

    ReplyDelete
  3. c:\go>go run "thisexample.go"

    When's Saturday?
    In two days
    Just woke up

    ReplyDelete
  4. Oh there is a golang code here ..

    ReplyDelete
  5. Really? I love the girls...Are you a man?

    ReplyDelete
  6. Next time, have the girls doing some kind of sexy action shot (porn)!

    Will make those millennials like Jack pee his pants probably!

    ReplyDelete
  7. Author be like:

    go fuck.yourself()

    ReplyDelete
  8. girls and code can stay, waste the dudes

    http://i331.photobucket.com/albums/l458/glvalentine/questionabletaste/hackers/10419.jpg

    ReplyDelete
  9. facked mothers programmers of new era.

    ReplyDelete
  10. despite how pleasing to the eye these two ladies are, this image really detracts from the important matter information seekers are actually here for.

    this sort of thing also doesn't exactly help the opinion (i believe anyway) female programmers have on their male counterparts.

    as we can see so far, more debate is spent on the image rather than golang subject matter.

    ReplyDelete