Files

33 lines
425 B
Go
Raw Permalink Normal View History

2026-06-11 15:46:19 +08:00
package main
import (
"context"
"fmt"
2026-06-23 15:33:22 +08:00
"os"
"path/filepath"
2026-06-11 15:46:19 +08:00
)
type App struct {
ctx context.Context
}
func NewApp() *App {
return &App{}
}
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
}
func (a *App) Greet(name string) string {
return fmt.Sprintf("Hello %s, It's show time!", name)
}
2026-06-23 15:33:22 +08:00
func getExeDir() string {
exe, err := os.Executable()
if err != nil {
return "."
}
return filepath.Dir(exe)
}