func getInterface(b interface{}) error {
	a, ok := b.(string)
	if !ok {
		return fmt.Errorf("this is not a string")
	}
	fmt.Println("This is a string: " + a)
	return nil
}
getInterface prints a string or returns an error if something other than string given
package main
import (
	"fmt"
	"math/rand"
	"strconv"
	"strings"
)
func main() {
	user := []struct {
		Name, City string
		level      int
	}{
		{"John", "Nashville", 45},
		{"Joe", "Orlando", 34},
	}
	for _, i := range user {
		fmt.Println(i.Name + " is in " + i.City)
	}
	for i := 0; i < len(user); i++ {
		fmt.Printf("%s is in %s\n", user[i].Name, user[i].City)
	}
	type u struct {
		Name, City string
		level      int
	}
	user1 := &u{"Eric", "Austin", 14}
	user = append(user, *user1)
	for i := 0; i < len(user); i++ {
		fmt.Printf("%s is in %s\n", user[i].Name, user[i].City)
	}
	c := ""
	for i := 0; i < 20; i++ {
		a := strconv.Itoa(rand.Intn(3))
		b := []byte(a)
		for _, i := range b {
			c += string(i) + ", "
		}
	}
	fmt.Println(c)
	err := getInterface(12)
	if err != nil {
		fmt.Println("error: " + err.Error())
	}
	fmt.Println(useInterface("test"))
	fmt.Println(useInterface([]byte("bytes")))
	fmt.Println(useInterface(123456))
	fmt.Println(useInterface(byte('a')))
	fmt.Println(useInterface([]string{"test", "two", "three", "four"}))
	fmt.Println(useInterface(1.2))
}