mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Dependency updates
This commit is contained in:
22
vendor/github.com/gobuffalo/gogen/append.go
generated
vendored
Normal file
22
vendor/github.com/gobuffalo/gogen/append.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package gogen
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/gobuffalo/genny"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Append allows to append source into a go file
|
||||
func Append(gf genny.File, expressions ...string) (genny.File, error) {
|
||||
pf, err := ParseFile(gf)
|
||||
if err != nil {
|
||||
return gf, errors.WithStack(err)
|
||||
}
|
||||
|
||||
gf = pf.File
|
||||
pf.Lines = append(pf.Lines, expressions...)
|
||||
|
||||
fileContent := strings.Join(pf.Lines, "\n")
|
||||
return genny.NewFile(gf.Name(), strings.NewReader(fileContent)), nil
|
||||
}
|
||||
Reference in New Issue
Block a user