Run go fmt.

This commit is contained in:
Greg 2019-09-06 10:46:23 -04:00
parent e108a9b7a7
commit e40e98aa25
2 changed files with 54 additions and 55 deletions

View File

@ -19,18 +19,18 @@ var (
func setFont() error { func setFont() error {
f, err := os.Open("/System/Library/Fonts/AppleSDGothicNeo.ttc") f, err := os.Open("/System/Library/Fonts/AppleSDGothicNeo.ttc")
if err != nil { if err != nil {
log(Info,"Cannot open system font.") log(Info, "Cannot open system font.")
return err return err
} }
collection, err := sfnt.ParseCollectionReaderAt(f) collection, err := sfnt.ParseCollectionReaderAt(f)
if err != nil { if err != nil {
log(Info,"Cannot parse system font.") log(Info, "Cannot parse system font.")
return err return err
} }
regular, err = collection.Font(0) regular, err = collection.Font(0)
if err != nil { if err != nil {
log(Info,"Cannot access first font in collection.") log(Info, "Cannot access first font in collection.")
return err return err
} }
return nil return nil
@ -41,7 +41,7 @@ func init() {
if err != nil { if err != nil {
regular, err = sfnt.Parse(goregular.TTF) regular, err = sfnt.Parse(goregular.TTF)
if err != nil { if err != nil {
log(Fatal,"Cannot parse default font: ", err) log(Fatal, "Cannot parse default font: ", err)
} }
} }
usr, err := user.Current() usr, err := user.Current()
@ -52,7 +52,7 @@ func init() {
if _, err := os.Stat(confDir); os.IsNotExist(err) { if _, err := os.Stat(confDir); os.IsNotExist(err) {
err = os.MkdirAll(confDir, 0700) err = os.MkdirAll(confDir, 0700)
if err != nil { if err != nil {
log(Info, "Cannot create configuration directory ",confDir) log(Info, "Cannot create configuration directory ", confDir)
log(Fatal, err) log(Fatal, err)
} else { } else {
log(Info, "Configuration directory created") log(Info, "Configuration directory created")

View File

@ -52,7 +52,7 @@ func main() {
log(Fatal, "Cannot parse configuration file: ", err) log(Fatal, "Cannot parse configuration file: ", err)
} }
store.Dir = Config.StoreDir store.Dir = Config.StoreDir
log(Info," StoreDir = ", store.Dir) log(Info, " StoreDir = ", store.Dir)
err = passgo.GetStore(&store) err = passgo.GetStore(&store)
if err != nil { if err != nil {
log(Fatal, err) log(Fatal, err)
@ -80,10 +80,10 @@ var (
store passgo.Store store passgo.Store
reload chan struct{} reload chan struct{}
updated chan struct{} updated chan struct{}
black = color.RGBA{A: 0xff, R:0, G:0, B:0} black = color.RGBA{A: 0xff, R: 0, G: 0, B: 0}
white = color.RGBA{A: 0xff, R:0xff, G:0xff, B:0xff} white = color.RGBA{A: 0xff, R: 0xff, G: 0xff, B: 0xff}
gray = color.RGBA{A: 0xff, R:0xf0, G:0xf0, B:0xf0} gray = color.RGBA{A: 0xff, R: 0xf0, G: 0xf0, B: 0xf0}
darkgray = color.RGBA{A: 0xff, R:0xa0, G:0xa0, B:0xa0} darkgray = color.RGBA{A: 0xff, R: 0xa0, G: 0xa0, B: 0xa0}
) )
func Updater() { func Updater() {
@ -257,10 +257,9 @@ func eventLoop() {
var c1 layout.FlexChild // flex child for title bar var c1 layout.FlexChild // flex child for title bar
face := faces.For(regular, ui.Sp(16)) face := faces.For(regular, ui.Sp(16))
margin := layout.UniformInset(ui.Dp(10)) margin := layout.UniformInset(ui.Dp(10))
title := &text.Label{Face: face, Text:"passgo"} title := &text.Label{Face: face, Text: "passgo"}
dotsbtn := &Button{ dotsbtn := &Button{
Face: face, Face: face,
Label: "\xe2\x8b\xae", Label: "\xe2\x8b\xae",
@ -353,7 +352,7 @@ func eventLoop() {
if len(passBtns) == 0 { if len(passBtns) == 0 {
c2 = flex.End(confBtn.Layout(c, q, ops, cs)) c2 = flex.End(confBtn.Layout(c, q, ops, cs))
if confBtn.Clicked() { if confBtn.Clicked() {
log(Info,"Configure") log(Info, "Configure")
w.Invalidate() w.Invalidate()
page = confPage page = confPage
} }
@ -433,7 +432,7 @@ func eventLoop() {
passgo.GetStore(&store) passgo.GetStore(&store)
Config.StoreDir = store.Dir Config.StoreDir = store.Dir
saveConf() saveConf()
reload <-struct{}{} reload <- struct{}{}
}() }()
page = listPage page = listPage
} }