Comments (3)
I just had a look at the Python bindings. The json library commonly used in Python does differentiate between int and float. If the number contains a dot, it is considered as a float, otherwise, it is considered as an int. Thus, the problem does not appear in Python.
from govpp.
I will have a look at other VPP bindings generators to see how they react to that.
from govpp.
I have played around a bit with this and so far it seems the library we are using to process JSON does not seem to be flexible for parsing numbers. There is MustGetUint64
method, but it does not return the correct number, most likely due incorrect conversions.
I also tried standard encoding/json
to parse number with max uint64
value and I was able to properly parse it only when decoding the value directly into uint64
variable or decoding into json.Number
(practically a string
) and then using strconv.ParseUint
to convert it into uint64
, because the json.Number
only has Float64
and Int64
methods for quick conversion.
I don't want to spend much more time than I already did, but I plan to come back to this issue later after I am done with other more urgent matters. The default
option for field is not used anywhere in the GoVPP beside being set as struct tag in the generated bindings and also there is no case that I know of in the official VPP API that has the default
set to max uint64.
Anyone is welcome to take a shot and open PR if you find a fix for this.
from govpp.
Related Issues (20)
- Fix: memory leak in receiveReplyInternal function
- [extras] Add documentation for govpp/extras and govpp/extras/gomemif HOT 3
- support for .tar.gz archives as input of govpp apigen
- Fix failing build for integration tests due removed version of package HOT 1
- Improve compatibility checking
- panic in the stats element HOT 5
- gomemif: Packet sent on Tx queue is received back on Rx queue of sender HOT 2
- Request for a tag HOT 1
- Using Log2RingSize custom set to more than 10 causes crash in packet writer for gomemif HOT 1
- Close connection event channel on disconnect
- Memory leak prevention proposal
- GoVPP CLI: worker to main thread when using api : communication problem ? HOT 2
- GoVPP Software Bill of Materials Generation HOT 3
- Would you please add an example using mulit rx and tx queue to extras/gomemif/examples HOT 1
- Add a dev and release VPP container HOT 3
- Fix import for extras in go.mod file HOT 3
- Possible memory leak in govpp from using time.NewTimer HOT 1
- Verify auto release process works HOT 2
- Disconnect Stats panic
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from govpp.