Skip to content

Instantly share code, notes, and snippets.

@gophersumit
Created June 15, 2019 07:54
Show Gist options
  • Select an option

  • Save gophersumit/25f2a8ece4c46b7d0ae83891ca76bb6b to your computer and use it in GitHub Desktop.

Select an option

Save gophersumit/25f2a8ece4c46b7d0ae83891ca76bb6b to your computer and use it in GitHub Desktop.
Increment operator in go
package main
import "fmt"
func main() {
x := 0
x++ //valid operation
fmt.Println(x++) // invalid operation x++ is not an expression
++x // invalid operation , prefix increment does not exist in go
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment