219 executedFiles map[int64]bool,
220 targetCommit int64,
221) []*MigrationFile {
222 filesToRun := []*MigrationFile{}223
224 if targetCommit == 0 {
225 targetCommit = math.MaxInt64
198 executedFiles map[int64]bool,
199 targetCommit int64,
200) []*MigrationFile {
201 filesToRun := []*MigrationFile{}202
203 if targetCommit == 0 {
204 targetCommit = math.MaxInt64
67 *MigrationScripts
68 version *semver.Version
69 }
70 plan := []versionPlan{} 71
72 // preventSnapshot can disable using snapshots even they exists.
73 preventSnapshot := false // TODO: read from configuration
An empty slice can be represented by nil
or an empty slice literal. They are
functionally equivalent — their len
and cap
are both zero — but the nil
slice is the preferred style. For more information about empty slices,
see Declaring Empty Slices.
package main
func foo() {
a := []int{}
}
package main
func foo() {
var a []int
}