Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nodes format not works #847

Merged
merged 7 commits into from
Nov 23, 2020
Merged

Conversation

nic-chen
Copy link
Member

@nic-chen nic-chen commented Nov 22, 2020

Please answer these questions before submitting a pull request

  • Why submit this pull request?
  • Bugfix
  • New feature provided
  • Improve performance

close #786
close #783

two issues are caused by nodes format

@codecov-io
Copy link

codecov-io commented Nov 22, 2020

Codecov Report

Merging #847 (a888733) into master (b989a0f) will increase coverage by 0.31%.
The diff coverage is 51.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #847      +/-   ##
==========================================
+ Coverage   42.64%   42.95%   +0.31%     
==========================================
  Files          18       18              
  Lines        1257     1271      +14     
==========================================
+ Hits          536      546      +10     
- Misses        630      633       +3     
- Partials       91       92       +1     
Impacted Files Coverage Δ
api/internal/core/entity/entity.go 0.00% <ø> (ø)
api/internal/core/entity/format.go 52.38% <51.61%> (+13.09%) ⬆️
api/internal/core/store/store.go 78.28% <0.00%> (-0.66%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b989a0f...a888733. Read the comment docs.

api/internal/core/entity/format.go Outdated Show resolved Hide resolved
api/internal/core/entity/format.go Outdated Show resolved Hide resolved
api/internal/core/entity/format.go Show resolved Hide resolved
api/internal/core/entity/format.go Outdated Show resolved Hide resolved
api/internal/core/entity/format.go Outdated Show resolved Hide resolved
assert.Equal(t, 1, nodes[0].Weight)
// json encode for client
res, err := json.Marshal(nodes)
assert.Nil(t,err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Style: need a space after ,.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

}`

// bind struct
var route Route
Copy link
Contributor

Choose a reason for hiding this comment

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

Redundant spaces after var.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

assert.Contains(t, jsonStr, `"weight":0`)
assert.Contains(t, jsonStr, `"port":8080`)
assert.Contains(t, jsonStr, `"host":"127.0.0.1"`)

Copy link
Contributor

Choose a reason for hiding this comment

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

Redundant empty line.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

"weight": 0
}]
}
}`
Copy link
Member

Choose a reason for hiding this comment

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

bad indentation

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants