From 3198659d11bd3982fd0be507a120d7891917ef38 Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Fri, 13 Aug 2021 19:46:58 +0200 Subject: [PATCH] Updated credits. --- cmd/tins2021/credits.go | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/cmd/tins2021/credits.go b/cmd/tins2021/credits.go index 89ea381..c7a9d00 100644 --- a/cmd/tins2021/credits.go +++ b/cmd/tins2021/credits.go @@ -36,7 +36,9 @@ func newCredits(app *appContext, ctx ui.Context) *credits { "zntg: an abstraction for rendering (UIs)", " - https://opslag.de/schobers/zntg", "", "allg5: an Allegro abstraction for Go", - " - https://opslag.de/schobers/allg5", + " - https://opslag.de/schobers/allg5", "", + "ut: a utility library", + " - https://opslag.de/schobers/ut", "", "", "**... and also using**", "Allegro: cross-platform development library", @@ -58,6 +60,10 @@ func newCredits(app *appContext, ctx ui.Context) *credits { " - https://github.com/nfnt/resize", "", "testify: a testing library for Go", " - https://github.com/stretchr/testify", "", + "beep: a sound library", + " - https://github.com/faiface/beep", "", + "oto: a low level sound library", + " - https://https://github.com/hajimehoshi/oto", "", "", "# THANKS", "", @@ -79,7 +85,9 @@ func (c *credits) Handle(ctx ui.Context, e ui.Event) bool { s := c.content[c.hovering] if strings.HasPrefix(s, " - https://") { url := s[3:] - c.openBrowser(url) + if err := c.openBrowser(url); err != nil { + log.Println(err) + } } } case *ui.KeyDownEvent: @@ -146,20 +154,16 @@ func (c *credits) fonts(ctx ui.Context) []ui.Font { return fonts } -func (c *credits) openBrowser(url string) { - var err error +func (c *credits) openBrowser(url string) error { switch runtime.GOOS { case "linux": - err = exec.Command("xdg-open", url).Start() + return exec.Command("xdg-open", url).Start() case "windows": - err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() + return exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() case "darwin": - err = exec.Command("open", url).Start() + return exec.Command("open", url).Start() default: - err = fmt.Errorf("unsupported platform") - } - if err != nil { - log.Println(err) + return fmt.Errorf("unsupported platform") } }