// GetInput implements input.File
GetInput implements input.File
// GetInput implements input . File
func (g *GopkgToml) GetInput() (input.Input, error) {
	if g.Path == "" {
		g.Path = "Gopkg.toml"
	}
	if g.ManagedHeader == "" {
		g.ManagedHeader = DefaultGopkgHeader
	}
	if g.DefaultUserContent == "" {
		g.DefaultUserContent = DefaultGopkgUserContent
	}
	lastBytes, err := ioutil.ReadFile(g.Path)
	if err != nil {
		g.UserContent = g.DefaultUserContent
	} else if g.UserContent, err = g.getUserContent(lastBytes); err != nil {
		return input.Input{}, err
	}
	g.Input.IfExistsAction = input.Overwrite
	g.TemplateBody = depTemplate
	return g.Input, nil
}
func ( g * GopkgToml ) GetInput ( ) ( input . Input , error ) { if g . Path == " " { g . Path = " " } if g . ManagedHeader == " " { g . ManagedHeader = DefaultGopkgHeader } if g . DefaultUserContent == " " { g . DefaultUserContent = DefaultGopkgUserContent } lastBytes , err := ioutil . ReadFile ( g . Path ) if err != nil { g . UserContent = g . DefaultUserContent } else if g . UserContent , err = g . getUserContent ( lastBytes ) ; err != nil { return input . Input { } , err } g . Input . IfExistsAction = input . Overwrite g . TemplateBody = depTemplate return g . Input , nil }
GetInput implements input.File
GetInput implements input . File
// Set the user content to be used if the Gopkg.toml doesn't exist // Set the user owned content from the last Gopkg.toml file - e.g. everything before the header