package main
import (
"fmt"
); //Here
func main() {
a := 4;//Here
b := 4;//Here
fmt.Println("The sum is: ", a+b);//Here
}
Is ok if i use them even that i konw that i dont need them is just that i use them in javascript and i like it, will it be any diferrence or a bad idea?
By convention, all Go code should be formatted through gofmt. This way, the devs’ brains are freed from style discussions and can focus on the important stuff.
Use a semicolon to join two related independent clauses in place of a comma and a coordinating conjunction. Semicolons should not be used between a dependent clause and an independent clause.
Well as others have said go fmt will get rid of them anyway. If you like them, that’s great, but when working with others it’s important to try to write idiomatic code, just like you can construct all kinds of “weird” sentences in English that people will likely understand. They may understand you, but it will sound odd and will affect their opinion of you.
If you are a contributor on a project of > 1, then it’s also important to follow standards so others can quickly pick up code and understand it. Of course that’s why we use auto-formatters, so we don’t spend precious time talking about things like semicolons when they don’t actually affect the program.