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

View File

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