Skip to content

Golang port#85

Open
egandro wants to merge 5 commits intoWebReflection:mainfrom
egandro:golang-port
Open

Golang port#85
egandro wants to merge 5 commits intoWebReflection:mainfrom
egandro:golang-port

Conversation

@egandro
Copy link

@egandro egandro commented Feb 13, 2026

I finally finished my golang port.

Please test.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 21998536178

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 15261346947: 0.0%
Covered Lines: 125
Relevant Lines: 125

💛 - Coveralls

@WebReflection
Copy link
Owner

this looks awesome to me ... but I ain't go expert, although I cannot spot anything obviously wrong with it ... are you confident this is going to play well between Go and others PLs too? That's my only concern, as in: it should be able to serialize correctly for Python/JS/PHP too, it should be able to deserialize from those PLs ... can we maybe automate such test based on the same test you do for identity preserved over "roundtrips"?

Anyway, thanks a lot and let's ship it sooner than later 🥳

@egandro
Copy link
Author

egandro commented Feb 14, 2026

Sure.

  1. We need (more sane) test cases.
  2. Let's use jq to format them
  3. Let's add sha256 checksums to them

Then we can compare input/output in all implementations

@WebReflection
Copy link
Owner

I think we can create a reference file without spaces and use it to roundtrip back and forward and if the outcome is identical we’ll be good?

just trying to keep it as simple as possible

@egandro
Copy link
Author

egandro commented Feb 14, 2026

Yes a reference file would be great.

We can also download some external very nested json and use them for testing during ci/cd.

Let me add a cli to the go project real quick and I past some code here.

@egandro
Copy link
Author

egandro commented Feb 14, 2026

  1. i create a flatten cli that works similar to gzip
  2. have a look at the toplevel test-dummy.sh file it makes sha256 tests on a normalized json files (spaces, keys sorted)

I think if we do this for all php, js, ... version to have expected sha256 inputs and outputs we ensure compatibility.

(let's get rid of the test-dummy.sh - i would love to just have a tests.json)

[
  { 
    "file": "file://tests/foo.json",
    "normal_sha256": "....",
    "flattened_sha256": "...."
  },
  { 
    "file": "https:://somewhere/extenal/foo.json,
    "normal_sha256": "....",
    "flattened_sha256": "...."
  }
]

And ever version needs to run this as integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants