Simple fix applied, expanded error message, gofmt

This commit is contained in:
asdf 2019-10-08 18:13:01 +11:00
parent 66acf6102f
commit 1045829076
1 changed files with 38 additions and 44 deletions

View File

@ -35,7 +35,6 @@ type client struct {
Certs gemini.TofuDigest Certs gemini.TofuDigest
} }
//------------------------------------------------\\ //------------------------------------------------\\
// + + + R E C E I V E R S + + + \\ // + + + R E C E I V E R S + + + \\
//--------------------------------------------------\\ //--------------------------------------------------\\
@ -239,7 +238,6 @@ func (c *client) TakeControlInput() {
} }
} }
func (c *client) routeCommandInput(com *cmdparse.Command) error { func (c *client) routeCommandInput(com *cmdparse.Command) error {
var err error var err error
switch com.Type { switch com.Type {
@ -470,7 +468,6 @@ func (c *client) doLinkCommandAs(action, target string, values []string) {
} }
} }
func (c *client) getCurrentPageUrl() (string, error) { func (c *client) getCurrentPageUrl() (string, error) {
if c.PageState.Length < 1 { if c.PageState.Length < 1 {
return "", fmt.Errorf("There are no pages in history") return "", fmt.Errorf("There are no pages in history")
@ -506,10 +503,10 @@ func (c *client) saveFile(u Url, name string) {
c.DrawMessage() c.DrawMessage()
return return
} }
savePath := c.Options["savelocation"] + name savePath := c.Options["savelocation"] + "/" + name
err = ioutil.WriteFile(savePath, file, 0644) err = ioutil.WriteFile(savePath, file, 0644)
if err != nil { if err != nil {
c.SetMessage("Error writing file to disk", true) c.SetMessage("Error writing file: "+err.Error(), true)
c.DrawMessage() c.DrawMessage()
return return
} }
@ -541,7 +538,6 @@ func (c *client) doLinkCommand(action, target string) {
c.DrawMessage() c.DrawMessage()
} }
switch action { switch action {
case "DELETE", "D": case "DELETE", "D":
msg, err := c.BookMarks.Delete(num) msg, err := c.BookMarks.Delete(num)
@ -972,7 +968,6 @@ func (c *client) Visit(url string) {
} }
} }
//------------------------------------------------\\ //------------------------------------------------\\
// + + + F U N C T I O N S + + + \\ // + + + F U N C T I O N S + + + \\
//--------------------------------------------------\\ //--------------------------------------------------\\
@ -981,4 +976,3 @@ func MakeClient(name string) *client {
c := client{0, 0, defaultOptions, "", false, MakePages(), MakeBookmarks(), MakeHeadbar(name), MakeFootbar(), gemini.MakeTofuDigest()} c := client{0, 0, defaultOptions, "", false, MakePages(), MakeBookmarks(), MakeHeadbar(name), MakeFootbar(), gemini.MakeTofuDigest()}
return &c return &c
} }