3 ms·
I prefer a sintaxis more expressive, concise and clean like Go's: package main type Foo struct { a, b, c int } func (f *Foo) bar(x int) int { retur
by Archos 15y ago
I prefer a sintaxis more expressive, concise and clean like Go's:
package main
type Foo struct {
a, b, c int
}
func (f *Foo) bar(x int) int {
return f.a + f.b + f.c + x
}
func main() {
afoo := Foo{1, 2, 3}
afoo.bar(3)
}
- Archos 15y agoIf I've said that one, it is because there is a compiler from Go to JavaScript under (advanced) development with several advantages over another compilers: + The lines numbers in the unminified generated JavaScript match up with the lines numbers in the original source file. + Generates minimized JavaScript. + Allows many type errors to be caught early in the development cycle, due to static typing. https://github.com/kless/GoScript https://github.com/kless/GoScript