Last active
October 11, 2022 03:46
-
-
Save dedSyn4ps3/4aef290947600c333282db52a3cc0827 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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