Skip to content

Instantly share code, notes, and snippets.

@iamralch
Created August 4, 2015 20:49
Show Gist options
  • Save iamralch/4b95e8d1631fd0a93dfe to your computer and use it in GitHub Desktop.
Save iamralch/4b95e8d1631fd0a93dfe to your computer and use it in GitHub Desktop.
Sample application used to demonstrates LLDB and DELVE debuggers
// main.go
package main
import "fmt"
type User struct {
FirstName string
LastName string
}
func (user User) String() string {
return fmt.Sprintf("%s %s", user.FirstName, user.LastName)
}
func main() {
user := User{
FirstName: "John",
LastName: "Smith",
}
message := FormatMessage(user, "Golang Weekly Newsletter #756")
for index := 0; index < 3; index++ {
fmt.Printf("Sending #%d message with %s\n", index, message)
}
}
func FormatMessage(user User, message string) string {
return fmt.Sprintf("body: %s by %s", message, user.String())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment