-
Notifications
You must be signed in to change notification settings - Fork 43
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
Adopt Go reflect package #700
Comments
์์ ์ฝ๋: https://play.golang.org/p/CGzM28ibuk4 ์ข๋ค์.. ใ ใ ๊ทผ๋ฐ ์ด ์์ ๋ก ํ์ฉํ๋ ค๋ฉด json tag๊ฐ ํ์ํ๋ ค๋์. |
์์ ์ฝ๋์์ type Person struct {
Name string //`json:"name"`
Nation string `json:"country"`
Zip int `json:"zipCode"`
} json ํ๊ทธ๋ empty ๋ผ์ ์ถ๋ ฅ๋์ง ์๋ ๊ฒ์ ํ์ธํ์ต๋๋ค. ๐
|
์ด๋ฐ๊ฑฐ ์ฌ์ฉํ๋ ค๋ฉด ๊ฒฐ๊ตญ json tag ๋ฅผ ์ด๋ ค์ผ ํ๋ ๊ฑธ๊น์.. ใ ใ |
์์ ์์ ์์๋, struct field์ JSON tag๊ฐ ๋ช ์๋์ด ์์ง ์์์ JSON ํ๊ทธ๊ฐ ์ถ๋ ฅ๋์ง ์์ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค. JSON tag๋ฅผ ๋ช
์ํ์ง ์์ผ๋ฉด, |
@seokho-son referred the Go reflect package. ๐
What would you like to be enhanced
:
Adopt Go reflect package
Why is this needed
:
TbSpecInfo
struct์ ํ๋ ์ด๋ฆ์string
์ผ๋ก ์กฐํํ๋ ์ฌ๋ก๊ฐ ์์cb-tumblebug/src/core/mcir/spec.go
Line 1025 in f509051
Proposed solution
:
=>
const StrNumvCPU string = "numvCPU"
์ ๊ฐ์ด ์ ์ํ๊ณ , reflect๋ ํ์ฉํ๋ ๋ฐฉํฅ์ผ๋ก ๊ฐ์ ํ ์ ์์The text was updated successfully, but these errors were encountered: