Skip to content

Instantly share code, notes, and snippets.

@hodzanassredin
Created August 14, 2013 07:58
Show Gist options
  • Save hodzanassredin/6228860 to your computer and use it in GitHub Desktop.
Save hodzanassredin/6228860 to your computer and use it in GitHub Desktop.
boolean trap solve in golang
package main
import(
"painter"
"fmt"
)
func main(){
res := painter.Repaint(painter.RepaintImmediate(false))
fmt.Println(res)
}
package painter
type RepaintImmediate bool
func Repaint(mode RepaintImmediate) string {
if mode {
return "Immediate"
} else {
return "Deferred"
}
panic("unreachable code")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment