How to create a function in go?



How to create a function in go?..

Answer / Soni Chauhan

To create a function in Go, use the `func` keyword followed by the function name, parameters, and return types. For example:n```gonfunc add(x int, y int) int {n return x + yn}n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Go Programming Language Interview Questions

What is default value of a global variable in go?

1 Answers  


What is goroutine in go programming language?

1 Answers  


What are methods in go?

1 Answers  


Does go support method overloading?

1 Answers  


Does golang support operator overloading?

1 Answers  


What is gopath environment variable?

1 Answers  


What is the default value of type bool in go programming?

1 Answers  


What is l-value and r-value in go?

1 Answers  


Who is the father of go (golang)?

1 Answers  


Does go (golang) support type inheritance?

1 Answers  


List out the built in support in go?

1 Answers  


How you can write multiline strings in go?

1 Answers  


Categories