System: Ubuntu 14.04 (Trusty Tahr)
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go
directory by:
package main | |
import ( | |
"fmt" | |
"sort" | |
) | |
type Person struct { | |
First string | |
Age int |
package main | |
import ( | |
"fmt" | |
) | |
/* | |
* What is Closure in go ? | |
* Closure is basically one scope enclosing other scopes . | |
* What does that mean ? |
package main | |
import ( | |
"fmt" | |
) | |
// This is my way of reducing in go | |
func main() { | |
reportMarks := []int{20, 45, 78, 3, 59, 95, 6} | |
totalMarks := sum(reportMarks...) |
package main | |
import ( | |
"fmt" | |
) | |
/* | |
* With Embedded structs,the embedded fields are promoted to the parent struct | |
* For Example, the programmer struct is embedded within the staffMembers struct. |
mapping := `{"settings":{"number_of_shards":1,"number_of_replicas":0},"mappings":{"cities":{"properties":{"CompanyName":{"type":"text"},"Addresses":{"type":"text"},"PostCode":{"type":"text"}}}}}` | |
elasticSURL := "https://xxxxxx" | |
client, err := elastic.NewClient(elastic.SetSniff(false), elastic.SetURL(elasticSURL)) | |
if err != nil { | |
// handle error | |
} | |
info, code, err := client.Ping(elasticSURL).Do(context.Background()) | |
if err != nil { | |
// handle error |
System: Ubuntu 14.04 (Trusty Tahr)
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go
directory by: