aboutsummaryrefslogtreecommitdiffstats
path: root/services/migrations/restore.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/migrations/restore.go')
-rw-r--r--services/migrations/restore.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/services/migrations/restore.go b/services/migrations/restore.go
index 357e995423..4499f78701 100644
--- a/services/migrations/restore.go
+++ b/services/migrations/restore.go
@@ -59,7 +59,7 @@ func (r *RepositoryRestorer) getRepoOptions() (map[string]string, error) {
return nil, err
}
- var opts = make(map[string]string)
+ opts := make(map[string]string)
err = yaml.Unmarshal(bs, &opts)
if err != nil {
return nil, err
@@ -91,7 +91,7 @@ func (r *RepositoryRestorer) GetRepoInfo() (*base.Repository, error) {
func (r *RepositoryRestorer) GetTopics() ([]string, error) {
p := filepath.Join(r.baseDir, "topic.yml")
- var topics = struct {
+ topics := struct {
Topics []string `yaml:"topics"`
}{}
@@ -109,7 +109,7 @@ func (r *RepositoryRestorer) GetTopics() ([]string, error) {
// GetMilestones returns milestones
func (r *RepositoryRestorer) GetMilestones() ([]*base.Milestone, error) {
- var milestones = make([]*base.Milestone, 0, 10)
+ milestones := make([]*base.Milestone, 0, 10)
p := filepath.Join(r.baseDir, "milestone.yml")
_, err := os.Stat(p)
if err != nil {
@@ -133,7 +133,7 @@ func (r *RepositoryRestorer) GetMilestones() ([]*base.Milestone, error) {
// GetReleases returns releases
func (r *RepositoryRestorer) GetReleases() ([]*base.Release, error) {
- var releases = make([]*base.Release, 0, 10)
+ releases := make([]*base.Release, 0, 10)
p := filepath.Join(r.baseDir, "release.yml")
_, err := os.Stat(p)
if err != nil {
@@ -164,7 +164,7 @@ func (r *RepositoryRestorer) GetReleases() ([]*base.Release, error) {
// GetLabels returns labels
func (r *RepositoryRestorer) GetLabels() ([]*base.Label, error) {
- var labels = make([]*base.Label, 0, 10)
+ labels := make([]*base.Label, 0, 10)
p := filepath.Join(r.baseDir, "label.yml")
_, err := os.Stat(p)
if err != nil {
@@ -188,7 +188,7 @@ func (r *RepositoryRestorer) GetLabels() ([]*base.Label, error) {
// GetIssues returns issues according start and limit
func (r *RepositoryRestorer) GetIssues(page, perPage int) ([]*base.Issue, bool, error) {
- var issues = make([]*base.Issue, 0, 10)
+ issues := make([]*base.Issue, 0, 10)
p := filepath.Join(r.baseDir, "issue.yml")
_, err := os.Stat(p)
if err != nil {
@@ -215,7 +215,7 @@ func (r *RepositoryRestorer) GetIssues(page, perPage int) ([]*base.Issue, bool,
// GetComments returns comments according issueNumber
func (r *RepositoryRestorer) GetComments(opts base.GetCommentOptions) ([]*base.Comment, bool, error) {
- var comments = make([]*base.Comment, 0, 10)
+ comments := make([]*base.Comment, 0, 10)
p := filepath.Join(r.commentDir(), fmt.Sprintf("%d.yml", opts.Context.ForeignID()))
_, err := os.Stat(p)
if err != nil {
@@ -239,7 +239,7 @@ func (r *RepositoryRestorer) GetComments(opts base.GetCommentOptions) ([]*base.C
// GetPullRequests returns pull requests according page and perPage
func (r *RepositoryRestorer) GetPullRequests(page, perPage int) ([]*base.PullRequest, bool, error) {
- var pulls = make([]*base.PullRequest, 0, 10)
+ pulls := make([]*base.PullRequest, 0, 10)
p := filepath.Join(r.baseDir, "pull_request.yml")
_, err := os.Stat(p)
if err != nil {
@@ -267,7 +267,7 @@ func (r *RepositoryRestorer) GetPullRequests(page, perPage int) ([]*base.PullReq
// GetReviews returns pull requests review
func (r *RepositoryRestorer) GetReviews(context base.IssueContext) ([]*base.Review, error) {
- var reviews = make([]*base.Review, 0, 10)
+ reviews := make([]*base.Review, 0, 10)
p := filepath.Join(r.reviewDir(), fmt.Sprintf("%d.yml", context.ForeignID()))
_, err := os.Stat(p)
if err != nil {