1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

golint comments

This commit is contained in:
Carlos Alexandro Becker 2017-01-15 08:48:27 -02:00
parent 2200e87764
commit 4aa098052d
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
5 changed files with 13 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import (
"golang.org/x/oauth2"
)
// GitHub client for the given token
func Github(token string) *github.Client {
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: token},

View File

@ -9,10 +9,12 @@ type GitInfo struct {
Diff string
}
// Repo owner/name pair
type Repo struct {
Owner, Name string
}
// Context carries along some data through the pipes
type Context struct {
Config *config.ProjectConfig
Token *string
@ -22,6 +24,7 @@ type Context struct {
Archives map[string]string
}
// New context
func New(config config.ProjectConfig) *Context {
return &Context{
Config: &config,

View File

@ -7,11 +7,13 @@ import (
"os"
)
// Archive as tar.gz
type Archive struct {
gw *gzip.Writer
tw *tar.Writer
}
// Close all closeables
func (a Archive) Close() error {
if err := a.tw.Close(); err != nil {
return err
@ -22,6 +24,7 @@ func (a Archive) Close() error {
return nil
}
// New tar.gz archive
func New(target *os.File) Archive {
gw := gzip.NewWriter(target)
tw := tar.NewWriter(gw)
@ -31,6 +34,7 @@ func New(target *os.File) Archive {
}
}
// Add file to the archive
func (a Archive) Add(name, path string) (err error) {
file, err := os.Open(path)
if err != nil {

View File

@ -6,20 +6,24 @@ import (
"os"
)
// Archive zip struct
type Archive struct {
z *zip.Writer
}
// Close all closeables
func (a Archive) Close() error {
return a.z.Close()
}
// New zip archive
func New(target *os.File) Archive {
return Archive{
z: zip.NewWriter(target),
}
}
// Add a file to the zip archive
func (a Archive) Add(name, path string) (err error) {
file, err := os.Open(path)
if err != nil {

View File

@ -7,6 +7,7 @@ import (
"os"
)
// For calculates the SHA256 sum for the given file
func For(path string) (result string, err error) {
file, err := os.Open(path)
if err != nil {