code: func parseInt(str string) int {
  	i := 0
  
  	if iv, err := strconv.ParseInt(str, 10, 32); err == nil {
  		i = int(iv)
  	}
  
  	return i
  }
docs: // parseInt parses the passed string as an int and returns it
  // or 0 on errors