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

strip config sufix from config structs

refs https://github.com/goreleaser/goreleaser/pull/81#discussion_r96141079
This commit is contained in:
Carlos Alexandro Becker 2017-01-15 14:37:00 -02:00
parent c65d4f86d1
commit c081854018
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 17 additions and 17 deletions

View File

@ -6,15 +6,15 @@ import (
yaml "gopkg.in/yaml.v1"
)
// HomebrewConfig contains the brew section
type HomebrewConfig struct {
// Homebrew contains the brew section
type Homebrew struct {
Repo string
Folder string
Caveats string
}
// BuildConfig contains the build configuration section
type BuildConfig struct {
// Build contains the build configuration section
type Build struct {
Goos []string
Goarch []string
Main string
@ -22,29 +22,29 @@ type BuildConfig struct {
BinaryName string `yaml:"binary_name"`
}
// ArchiveConfig config used for the archive
type ArchiveConfig struct {
// Archive config used for the archive
type Archive struct {
Format string
NameTemplate string `yaml:"name_template"`
Replacements map[string]string
Files []string
}
// ReleaseConfig config used for the GitHub release
type ReleaseConfig struct {
// Release config used for the GitHub release
type Release struct {
Repo string
}
// ProjectConfig includes all project configuration
type ProjectConfig struct {
Release ReleaseConfig
Brew HomebrewConfig
Build BuildConfig
Archive ArchiveConfig
// Project includes all project configuration
type Project struct {
Release Release
Brew Homebrew
Build Build
Archive Archive
}
// Load config file
func Load(file string) (config ProjectConfig, err error) {
func Load(file string) (config Project, err error) {
data, err := ioutil.ReadFile(file)
if err != nil {
return config, err

View File

@ -16,7 +16,7 @@ type Repo struct {
// Context carries along some data through the pipes
type Context struct {
Config *config.ProjectConfig
Config *config.Project
Token *string
Git *GitInfo
ReleaseRepo *Repo
@ -25,7 +25,7 @@ type Context struct {
}
// New context
func New(config config.ProjectConfig) *Context {
func New(config config.Project) *Context {
return &Context{
Config: &config,
Archives: map[string]string{},