package test

import (
	"fmt"
	"testing"
)

func helper_1(a int) {
	switch a {
	case 1:
	case 2:
		fmt.Println(a, 2)
	default:
		fmt.Println("nn")
	}
}

func TestSwitch(t *testing.T) {
	helper_1(1)
}

func helper_2(a int, b *int) {
	var p int = 3

	defer func() {
		*b = p
	}()

	p = 4 + 1
	fmt.Println(p)
}
func TestDefer(t *testing.T) {
	var b int
	helper_2(1, &b)
	fmt.Println("b =", b)
}
