PageRenderTime 39ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/go/using_extend_runme.go

#
Go | 30 lines | 23 code | 7 blank | 0 comment | 12 complexity | 5dd23c2a7e1b586b8e408589b3a6bdd8 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. package main
  2. import . "./using_extend"
  3. func main() {
  4. f := NewFooBar()
  5. if f.Blah(3).(int) != 3 {
  6. panic("blah(int)")
  7. }
  8. if f.Blah(3.5) != 3.5 {
  9. panic("blah(double)")
  10. }
  11. if f.Blah("hello").(string) != "hello" {
  12. panic("blah(char *)")
  13. }
  14. if f.Blah(3, 4).(int) != 7 {
  15. panic("blah(int,int)")
  16. }
  17. if f.Blah(3.5, 7.5) != (3.5 + 7.5) {
  18. panic("blah(double,double)")
  19. }
  20. if f.Duh(3) != 3 {
  21. panic("duh(int)")
  22. }
  23. }