There are two ways to ping
go internal ping sys ping The go internal ping works only as root, therefor a sys ping is also provided until I can figure out how to fix this problem.
Website
Code is available at https://bitbucket.org/gotamer
Now gotamer/mail also implements the io.Writer interface. Example:
package main import ( "fmt" "bitbucket.org/gotamer/mail" ) func main() { s := new(mail.Smtp) s.SetHostname("smtp.gmail.com") s.SetHostport(587) s.SetFromName("GoTamer") s.SetFromAddr("xxxx@gmail.com") s.SetPassword("*********") s.AddToAddr("to@example.com") s.SetSubject("GoTamer test smtp mail") s.SetBody("The Writer below should replace this default line") if _, err := fmt.Fprintf(s, "Hello, smtp mail writer\n"); err != nil { fmt.Println(err) } } As an alternative to AddToAddr() there is SetToAddrs(). With SetToAddrs() you can set one or more recipients as a comma separated list.
Generates a random number between min and max
func IRand(min, max int) int
Generates a random strings between min and max
func SRand(min, max int, readable bool) string
Reverses the string
func Reverse(s string) strings
Shuffles the string
func Shuffle(s string) string
Links Pkg Documantation Repository
Golang has a package called Gob to encode and decode values in to go specific binary format for transmiting as streams or for saving to file.
Below are two functions, Load and Save to encode/decode go values including struct’s in to files.
package main import ( "encoding/gob" "fmt" "os" "runtime" ) const file = "/tmp/test.gob" type User struct { Name, Pass string } func main(){ var datato = &User{"Donald","DuckPass"} var datafrom = new(User) err := Save(file, datato) Check(err) err = Load(file, datafrom) Check(err) fmt.
Features Citadel Sync will work on most operating systems including Linux, Mac, PC, Android … Converts a multi vCard file in to many for each to hold a single contact Adds UID and REV fields to the vCard if missing Uploads vCards to a given remote [Citadel] Mail Server You can specify, which folder on the server to upload to Can populate the Display name field from first and last name, or populate first and last name from display name Features planned Compare revision state and sync in case you modify a vCard on the server.
I don’t use this, since I need often more but isn’t this just need?
http://play.golang.org/p/QFheQeChIn
package main import "log" const debug debugging = true // or flip to false type debugging bool func (d debugging) Printf(format string, args ...interface{}) { d { log.Printf(format, args...) } } func main() { debug.Printf("foo %d %.2f", 42, 12.7) }
I just dumped my home made php script md2html and switched to jkl.
This is basiclly my test post!
jkl is a static site generator written in Go, based on Jekyll.
All I had to do was convert my template to Go tempates, and add the YAML front matter to my markdown files.
jkl is by far faster then md2html provides a build in server The Go templates are a bid easier to work with.