gnmic icon indicating copy to clipboard operation
gnmic copied to clipboard

Extra space seen after colon (:) in the output of gnmic versions >= 0.40.0

Open ShPundir opened this issue 2 months ago • 1 comments

While updating gnmic version we noticed that, there is an extra space after every colon (:) in the gnmic output. We verified that this has started after 0.39.0 version and is seen in all >=0.40.0 versions. Here is the sample output of gnmic 0.36.0 (left) and gnmic 0.41.0 (right)

Image

Sample command: gnmic get -a <IP>:<port> -p <pwd> -u <username>--skip-verify --path /list-all-type-key-test --format prototext -e JSON --timeout 60s

ShPundir avatar Oct 15 '25 06:10 ShPundir

That's coming from the Go protobuf library, it intentionally adds randomized whitespace to the output to discourage users from relying on byte-for-byte comparison of marshaled output, see here

There are ways to normalize it but it comes at an extra processing cost.

karimra avatar Oct 23 '25 17:10 karimra