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:
Elias Naur
2019-07-22 11:39:34 +02:00
parent c080a54038
commit b45222b457
3 changed files with 14 additions and 22 deletions
+12 -15
View File
@@ -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 {