Skip to content

Conversation

beanieboi
Copy link

No description provided.

@@ -67,6 +70,11 @@ type MigrationFiles []MigrationFile
func (f *File) ReadContent() error {
if len(f.Content) == 0 {
content, err := ioutil.ReadFile(path.Join(f.Path, f.FileName))

r := bytes.NewBuffer(content)
line, err := r.ReadString('\n')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly we could just do a https://golang.org/pkg/bytes/#Contains

so

if bytes.Contains(content, []byte("-- @Notransactions")){
}

of HasPrefix if we want to anchor it to the start of the file.

@bfosberry
Copy link

This is super simple and gets is where we want to go. I'll be super happy if we can contribute this back to the maintainer and less happy if we diverge from the main repo with this. We do have other projects where we vendor a non-standard version and ideally we can bring that number to zero.

@bfosberry bfosberry merged commit 6dd6484 into master Apr 28, 2016
@bfosberry bfosberry deleted the no-transactions branch April 28, 2016 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants