Skip to content

alnkapa/Go2ErrorHandlingFeedback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

func printSum(a, b string) error {
check1 := func (x int, err error) { // function with any name
  fmt.Println("result err:",err)
  return x 
}
x := check1 strconv.Atoi(a) // on err != nil return from function "printSum"
y := check1(strconv.Atoi(b)) // on err != nil continue execute function "printSum"
fmt.Println("result:", x + y)
return nil
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages