bool.go 386 B

12345678910111213141516171819202122
  1. package session
  2. func (this *session) IsSetBool(name string) bool {
  3. if _, ok := this.v.Bool[name]; ok {
  4. return true
  5. } else {
  6. return false
  7. }
  8. }
  9. func (this *session) GetBool(name string, def bool) bool {
  10. if v, ok := this.v.Bool[name]; ok {
  11. return v
  12. } else {
  13. return def
  14. }
  15. }
  16. func (this *session) SetBool(name string, value bool) {
  17. this.v.Bool[name] = value
  18. this.c = true
  19. }