mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
apps: drop init funcs
Now that Gio runs main functions everywhere, init func are no longer necessary. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+12
-15
@@ -126,25 +126,12 @@ var theme struct {
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
initProfiling()
|
||||
if *token == "" {
|
||||
fmt.Println("The quota for anonymous GitHub API access is very low. Specify a token with -token to avoid quota errors.")
|
||||
fmt.Println("See https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line.")
|
||||
}
|
||||
app.Main()
|
||||
}
|
||||
|
||||
func initProfiling() {
|
||||
if !*profile {
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
log.Println(http.ListenAndServe("localhost:6060", nil))
|
||||
}()
|
||||
}
|
||||
|
||||
func init() {
|
||||
flag.Parse()
|
||||
initProfiling()
|
||||
go func() {
|
||||
fonts.regular = mustLoadFont(goregular.TTF)
|
||||
fonts.bold = mustLoadFont(gobold.TTF)
|
||||
@@ -164,6 +151,16 @@ func init() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}()
|
||||
app.Main()
|
||||
}
|
||||
|
||||
func initProfiling() {
|
||||
if !*profile {
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
log.Println(http.ListenAndServe("localhost:6060", nil))
|
||||
}()
|
||||
}
|
||||
|
||||
func colorMaterial(ops *ui.Ops, color color.RGBA) ui.MacroOp {
|
||||
|
||||
Reference in New Issue
Block a user