Skip to content

Instantly share code, notes, and snippets.

@dedSyn4ps3
Last active October 11, 2022 03:46
Show Gist options
  • Save dedSyn4ps3/4aef290947600c333282db52a3cc0827 to your computer and use it in GitHub Desktop.
Save dedSyn4ps3/4aef290947600c333282db52a3cc0827 to your computer and use it in GitHub Desktop.
package main
import (
"context"
"fmt"
)
// App struct
type App struct {
ctx context.Context
}
// NewApp creates a new App application struct
func NewApp() *App {
return &App{}
}
// startup is called when the app starts. The context is saved
// so we can call the runtime methods
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
}
// Greet returns a greeting for the given name
func (a *App) Greet(name string) string {
return fmt.Sprintf("Hello %s, It's show time!", name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment