// This is a small application which demos Go's error handling semantics.
package main

import (
	"fmt"
	"os/user"
)

func main() {
	// If you don't handle err (i.e. "user := user.Current()", you'll get
	// "assignment mismatch: 1 variable but user.Current returns 2 values"
	// error and the code will not compile.
	user, err := user.Current()
	
	// If you remove this block, you'll get an
	// "declared and not used: err" error and the code will not compile.
	if(err != nil){
		panic("Error occurred while getting user details.")
	}

	fmt.Println("Your username is " + user.Username + ".")
}
