瀏覽代碼

Merge pull request #22 from abhinav/goimports

style: Run goimports on all Go files
local-workflow
Matt Baer 5 年之前
committed by GitHub
父節點
當前提交
4b8449161b
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 11 個文件被更改,包括 38 次插入20 次删除
  1. +10
    -1
      .github/CONTRIBUTING.md
  2. +4
    -3
      cmd/writeas/api.go
  3. +3
    -2
      cmd/writeas/cli.go
  4. +4
    -3
      cmd/writeas/commands.go
  5. +2
    -1
      cmd/writeas/logging.go
  6. +1
    -1
      cmd/writeas/options.go
  7. +3
    -2
      cmd/writeas/posts.go
  8. +2
    -1
      cmd/writeas/posts_nix.go
  9. +3
    -2
      cmd/writeas/sync.go
  10. +2
    -1
      cmd/writeas/tor.go
  11. +4
    -3
      cmd/writeas/userconfig.go

+ 10
- 1
.github/CONTRIBUTING.md 查看文件

@@ -22,11 +22,20 @@ Please follow our coding conventions below and make sure all of your commits are

We strive for consistency above all. Reading the small codebase should give you a good idea of the conventions we follow.

* We use `go fmt` before committing anything
* We use `goimports` before committing anything
* We aim to document all exported entities
* Go files are broken up into logical functional components
* General functions are extracted into modules when possible

### Import Groups

We aim for two import groups:

* Standard library imports
* Everything else

`goimports` already does this for you along with running `go fmt`.

## Design conventions

We maintain a few high-level design principles in all decisions we make. Keep these in mind while devising new functionality:


+ 4
- 3
cmd/writeas/api.go 查看文件

@@ -2,12 +2,13 @@ package main

import (
"fmt"
"path/filepath"

"github.com/atotto/clipboard"
"github.com/writeas/web-core/posts"
"github.com/writeas/writeas-cli/fileutils"
"go.code.as/writeas.v2"
"gopkg.in/urfave/cli.v1"
"path/filepath"
writeas "go.code.as/writeas.v2"
cli "gopkg.in/urfave/cli.v1"
)

const (


+ 3
- 2
cmd/writeas/cli.go 查看文件

@@ -2,11 +2,12 @@ package main

import (
"bufio"
"go.code.as/writeas.v2"
"gopkg.in/urfave/cli.v1"
"io"
"log"
"os"

writeas "go.code.as/writeas.v2"
cli "gopkg.in/urfave/cli.v1"
)

// API constants for communicating with Write.as.


+ 4
- 3
cmd/writeas/commands.go 查看文件

@@ -2,12 +2,13 @@ package main

import (
"fmt"
"github.com/howeyc/gopass"
"github.com/writeas/writeas-cli/fileutils"
"gopkg.in/urfave/cli.v1"
"io/ioutil"
"os"
"path/filepath"

"github.com/howeyc/gopass"
"github.com/writeas/writeas-cli/fileutils"
cli "gopkg.in/urfave/cli.v1"
)

func cmdPost(c *cli.Context) error {


+ 2
- 1
cmd/writeas/logging.go 查看文件

@@ -2,8 +2,9 @@ package main

import (
"fmt"
"gopkg.in/urfave/cli.v1"
"os"

cli "gopkg.in/urfave/cli.v1"
)

// Info logs general diagnostic messages, shown only when the -v or --verbose


+ 1
- 1
cmd/writeas/options.go 查看文件

@@ -2,7 +2,7 @@ package main

import (
"github.com/cloudfoundry/jibber_jabber"
"gopkg.in/urfave/cli.v1"
cli "gopkg.in/urfave/cli.v1"
)

func userAgent(c *cli.Context) string {


+ 3
- 2
cmd/writeas/posts.go 查看文件

@@ -2,12 +2,13 @@ package main

import (
"fmt"
"github.com/writeas/writeas-cli/fileutils"
"go.code.as/writeas.v2"
"io/ioutil"
"os"
"path/filepath"
"strings"

"github.com/writeas/writeas-cli/fileutils"
writeas "go.code.as/writeas.v2"
)

const (


+ 2
- 1
cmd/writeas/posts_nix.go 查看文件

@@ -4,8 +4,9 @@ package main

import (
"fmt"
"github.com/mitchellh/go-homedir"
"os/exec"

homedir "github.com/mitchellh/go-homedir"
)

const (


+ 3
- 2
cmd/writeas/sync.go 查看文件

@@ -3,11 +3,12 @@ package main
import (
//"github.com/writeas/writeas-cli/sync"
"fmt"
"github.com/writeas/writeas-cli/fileutils"
"gopkg.in/urfave/cli.v1"
"io/ioutil"
"os"
"path/filepath"

"github.com/writeas/writeas-cli/fileutils"
cli "gopkg.in/urfave/cli.v1"
)

const (


+ 2
- 1
cmd/writeas/tor.go 查看文件

@@ -1,9 +1,10 @@
package main

import (
"code.as/core/socks"
"fmt"
"net/http"

"code.as/core/socks"
)

var (


+ 4
- 3
cmd/writeas/userconfig.go 查看文件

@@ -2,11 +2,12 @@ package main

import (
"encoding/json"
"github.com/writeas/writeas-cli/fileutils"
"go.code.as/writeas.v2"
"gopkg.in/ini.v1"
"io/ioutil"
"path/filepath"

"github.com/writeas/writeas-cli/fileutils"
writeas "go.code.as/writeas.v2"
ini "gopkg.in/ini.v1"
)

const (


Loading…
取消
儲存