You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@devlake.apache.org by GitBox <gi...@apache.org> on 2022/05/18 11:12:29 UTC

[GitHub] [incubator-devlake] warren830 opened a new issue, #1915: Add more type checks to `DecodeStruct` and `EncodeStruct`

warren830 opened a new issue, #1915:
URL: https://github.com/apache/incubator-devlake/issues/1915

   ## Description
   Right now, in our `DecodeStruct` and `EncodeStruct`, we only check `string`, `int`, `int64`, `float64` inside the `switch`
   It works properly for now. But we want to make these two funcs more general.
   
   ## Describe the solution you'd like
   1. check  all the cases  in `json.literalStore` 
   2. supplement the cases we don't have in `DecodeStruct` and `EncodeStruct`
   3. you can also use `reflect.string` to replace `case "string"` in `DecodeStruct` and `EncodeStruct`
   
   ## Has the Feature been Requested Before?
   Please link any other
   
   ## Describe alternatives you've considered
   A clear and concise description of any alternative solutions or features you've considered.
   
   ## Additional context
   Add any other context or screenshots about the feature request here.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] fatelei commented on issue #1915: Add more type checks to `DecodeStruct` and `EncodeStruct`

Posted by GitBox <gi...@apache.org>.
fatelei commented on issue #1915:
URL: https://github.com/apache/incubator-devlake/issues/1915#issuecomment-1134231132

   assign to me


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] fatelei commented on issue #1915: Add more type checks to `DecodeStruct` and `EncodeStruct`

Posted by GitBox <gi...@apache.org>.
fatelei commented on issue #1915:
URL: https://github.com/apache/incubator-devlake/issues/1915#issuecomment-1134135416

   ok


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] klesh closed issue #1915: Add more type checks to `DecodeStruct` and `EncodeStruct`

Posted by GitBox <gi...@apache.org>.
klesh closed issue #1915: Add more type checks to `DecodeStruct` and `EncodeStruct`
URL: https://github.com/apache/incubator-devlake/issues/1915


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] fatelei commented on issue #1915: Add more type checks to `DecodeStruct` and `EncodeStruct`

Posted by GitBox <gi...@apache.org>.
fatelei commented on issue #1915:
URL: https://github.com/apache/incubator-devlake/issues/1915#issuecomment-1132604326

   i check the `DecodeStruct` and `EncodeStruct` method
   - `DecodeStruct` map struct to viper config
   - `EncodeStruct` map viper config to struct
   
   viper config support data type is:
   - bool
   - int
   - string
   - int slice
   - string slice
   - map[string]interface{}
   - map[string]string
   - float64
   - interface
   
   so the two method should support
   - int slice
   - string slice
   - map[string]interface{}
   - map[string]string
   - bool
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] warren830 commented on issue #1915: Add more type checks to `DecodeStruct` and `EncodeStruct`

Posted by GitBox <gi...@apache.org>.
warren830 commented on issue #1915:
URL: https://github.com/apache/incubator-devlake/issues/1915#issuecomment-1134129863

   > i check the `DecodeStruct` and `EncodeStruct` method
   > 
   > * `DecodeStruct` map struct to viper config
   > * `EncodeStruct` map viper config to struct
   > 
   > viper config support data type is:
   > 
   > * bool
   > * int
   > * string
   > * int slice
   > * string slice
   > * map[string]interface{}
   > * map[string]string
   > * float64
   > * interface
   > 
   > so the two method should support
   > 
   > * int slice
   > * string slice
   > * map[string]interface{}
   > * map[string]string
   > * bool
   
   Yes, perfectly right. Do you want to take this one?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org