Skip to content
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

[pull] master from ugorji:master #99

Open
wants to merge 91 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
077f6d3
codec: switch from travis to github actions
ugorji Dec 20, 2022
7028a4a
codec: fix error in github action
ugorji Dec 20, 2022
f3ea3ce
codec: fix error in github actions
ugorji Dec 20, 2022
5d9a401
codec: update github actions
ugorji Dec 20, 2022
000d505
codec: update github actions
ugorji Dec 20, 2022
d31c1f2
codec: update github actions
ugorji Dec 20, 2022
9eb575f
codec: update github actions to set fail-fast=true and run go mod tidy
ugorji Dec 20, 2022
5e4d76c
codec: update github actions
ugorji Dec 20, 2022
734f74a
codec: update github actions
ugorji Dec 20, 2022
b06f6b8
codec: update github actions
ugorji Dec 20, 2022
b751ed5
codec: update github actions
ugorji Dec 20, 2022
c8f9f3b
codec: update github actions
ugorji Dec 20, 2022
34af995
codec: update github actions
ugorji Dec 20, 2022
bb17132
codec: update github actions
ugorji Dec 20, 2022
7ae7325
codec: update github actions
ugorji Dec 20, 2022
19ed791
codec: update github actions
ugorji Dec 20, 2022
aaf9c01
go/codec: update badges for github actions (build/test status) and pk…
ugorji Dec 20, 2022
ca3da63
codec: update github actions
ugorji Dec 20, 2022
6c97613
codec: announcing removal of requirements cycle in modules from v1.3
ugorji Dec 21, 2022
317a5e1
codecgen: updating in-code module version and adding blank import for…
ugorji Dec 21, 2022
5a276ed
codec: fix growslice to accomodate reorganization in golang runtime code
ugorji Dec 21, 2022
688d834
codec: add go1.20 to testing matrix
ugorji Dec 21, 2022
6f924ee
codecgen: separate blank import for codec package to be ignored durin…
ugorji Dec 22, 2022
4e13a4e
codec: define TypeInfo.flagMarshalInterface to denote that this type …
ugorji Dec 22, 2022
99c9719
codec: optimize canonical encoding to short-circuit EncodeValue dance
ugorji Dec 22, 2022
bb2c710
codecgen: optimize canonical encoding to handle extensions and custom…
ugorji Dec 22, 2022
f680b6e
codecgen: updated generated test file
ugorji Dec 22, 2022
3cfaa07
codec: run go1.19 gofmt on codebase to get formating churn one time
ugorji Dec 22, 2022
f6cd53a
codec: README updated due to gofmt changes in go1.19
ugorji Dec 23, 2022
a76d152
codecgen: canonical: handle inline if key is an ordered type, else de…
ugorji Dec 23, 2022
2c026a5
codec/bench: fail benchmark if a panic occurs
ugorji Dec 27, 2022
e633657
codec: remove unused typeInfo.flagCustom field
ugorji Dec 27, 2022
7c9d865
codec: FAQ: remove requirements cycle for .../go/codec and .../go in …
ugorji Dec 27, 2022
84ddb2d
codec/bench: ffjson generated code which cannot be compiled
ugorji Dec 27, 2022
489263b
codec/bench: updated bench.out.txt for v1.2.8
ugorji Dec 27, 2022
5041716
updating go.mod release to v1.2.8
ugorji Dec 27, 2022
985f494
updating go.mod release to v1.2.8
ugorji Dec 27, 2022
e152003
updating go.mod release to v1.2.8
ugorji Dec 27, 2022
e75e953
updating go.mod release to v1.2.8
ugorji Dec 27, 2022
e4956d8
updating go.mod release to v1.2.8
ugorji Dec 27, 2022
d93d7b2
updating go.mod release to v1.2.8
ugorji Dec 27, 2022
31eeefa
updating go.mod release to v1.2.8
ugorji Dec 27, 2022
afe6dbb
codec/bench: add github.com/goccy/go-json to benchmarks
ugorji Dec 30, 2022
7f168b0
codec: growslice: use runtime.growslice directly to avoid zero'ing me…
ugorji Dec 30, 2022
9cd8c34
codec: clean up reader so there's just one io-based reader
ugorji Dec 30, 2022
6747c89
codec: some optimizations (bounds check elimination, cleanups)
ugorji Jan 4, 2023
73ac10b
codec: remove function wrapping reflect.Value.Type() - call it directly
ugorji Jan 4, 2023
e4342dc
codec: readFull: increment bytes read by the actual number
ugorji Jan 5, 2023
b2f56a7
codec: json: minor cleanups
ugorji Jan 5, 2023
1e42820
codec: json: minor clean up (field names, remove comments, etc)
ugorji Jan 5, 2023
4e107ae
codec: add copybytes optimization
ugorji Jan 5, 2023
a7b31a0
codec: some cleanups (copybytes, readLit, readn3)
ugorji Jan 8, 2023
2a1ab51
codec: json: optimize bool encoding, and clean up bool decoding in na…
ugorji Jan 9, 2023
308de61
codec/bench: benchmark using codec's encoder functions
ugorji Feb 3, 2023
aadf505
codecgen: updated genVersion to 26
ugorji Feb 3, 2023
561b807
codec: Use ContainerNext everywhere CheckBreak is used, and enable mo…
ugorji Feb 3, 2023
b539a17
updating go.mod release to v1.2.9
ugorji Feb 3, 2023
b82cf6e
updating go.mod release to v1.2.9
ugorji Feb 3, 2023
4ee3757
updating go.mod release to v1.2.9
ugorji Feb 3, 2023
ef5844a
codec: updating go.sum for bench and codecgen
ugorji Feb 9, 2023
95fe2c0
codec: fixing generated code for decoding from an array
ugorji Feb 9, 2023
8c5d7aa
codec: fix decoding struct from array - counter should be incremented…
ugorji Feb 9, 2023
b7b66ee
codec: set containerState to containerMapKey when encoding interface{…
ugorji Feb 19, 2023
1b09d78
updating go.mod release to v1.2.10
ugorji Feb 20, 2023
a5223cc
updating go.mod release to v1.2.10
ugorji Feb 20, 2023
f158563
updating go.mod release to v1.2.10
ugorji Feb 20, 2023
0f9571b
codecgen: updated genVersion
ugorji Feb 24, 2023
b733c52
codecgen: updated genVersion and other version constants to 1.2.10
ugorji Feb 24, 2023
734c917
codecgen: updated generated files to incorporate subsequent fix for d…
ugorji Feb 24, 2023
421864a
codecgen: fix decoding missing fields of struct from array, due to do…
ugorji Feb 24, 2023
428cefd
codec: nits: minor documentation and README update
ugorji Mar 8, 2023
dbafd97
codec: update go.sum to include codec v1.2.10
ugorji Mar 8, 2023
29258c4
codecgen: update genVersion=28 for v1.2.11
ugorji Mar 8, 2023
732f9d3
updating go.mod release to v1.2.11
ugorji Mar 8, 2023
41e7844
updating go.mod release to v1.2.11
ugorji Mar 8, 2023
3a08a64
updating go.mod release to v1.2.11
ugorji Mar 8, 2023
879e7ea
codec: test: use Intn(2) so we get 0 or 1
ugorji Nov 28, 2023
8286c2d
codecgen: use base32 with unique letters for type names
ugorji Nov 28, 2023
f7f63a0
CBOR: Reject malformed and invalid indefinite-length strings (#405)
benluddy Nov 28, 2023
126da48
shorter doc comments for fully-deprecated (ignored) fields/methods (#…
extemporalgenome Nov 28, 2023
a315d04
codec: nit: clean up some comments
ugorji Nov 28, 2023
1acedc2
codec: cbor: cbor: use fmtTime instead of time.Format for RFC3339Nano
ugorji Nov 28, 2023
48ba79b
codec: expose Handle.Name() via (En|De)coder, for general use (as nee…
ugorji Nov 28, 2023
77eda90
codec: json: document behaviour differences vs encoding/json package
ugorji Nov 28, 2023
190086c
codec: cbor test: support debugging and reuse testCborH
ugorji Nov 28, 2023
43b79bf
codec: return io.ErrUnexpectedEOF (not io.EOF) when incomplete data read
ugorji Nov 28, 2023
23d384a
codec: bench: update latest benchmark results
ugorji Nov 30, 2023
407a57a
updating go.mod release to v1.2.12
ugorji Nov 30, 2023
10952fa
updating go.mod release to v1.2.12
ugorji Nov 30, 2023
2d571c5
updating go.mod release to v1.2.12
ugorji Nov 30, 2023
07c54c2
codec: json: leading zeros are not allowed in decimal numbers
ugorji Mar 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build and Test go-codec
on:
workflow_dispatch: {}
push:
branches: [ master ]
paths: [ '**.go' ]
pull_request:
branches: [ master ]
paths: [ '**.go' ]
jobs:
tests:
strategy:
fail-fast: false
matrix:
go: [ '1.19', '1.17', '1.11', '1.20.0-rc.1' ]
arch: [ amd64 ]
os: [ ubuntu-latest ]
include:
- go: '1.19'
arch: '386'
os: ubuntu-latest
runs-on: ${{ matrix.os }}
env:
GO111MODULE: 'on'
COVER_GO_VERSION: '1.19'
GOARCH: ${{ matrix.arch }}
name: go ${{ matrix.go }} on ${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Run tests
shell: bash
run: |
cd codec
go mod edit -droprequire github.com/ugorji/go
t=( "" "safe" "notfastpath" "codecgen" )
for i in "${t[@]}"; do go test "-tags=alltests ${i}" "-run=Suite" "-coverprofile=coverage.${{ matrix.go }}.${{ matrix.arch }}.${i}.txt"; done
- uses: codecov/codecov-action@v3
if: matrix.go == env.COVER_GO_VERSION
with:
directory: ./codec


# No need to go get, as github knows its working out of this folder.
#
# Most of our code is the same since go1.12; before that we selectively compile files using build constraints.
#
# We test against the following go releases
# - latest production release
# - 2 releases before that
# - an archive version (go 1.11)
# - and a beta/rc of development release (so github can just download an archive of it and use)
#
# Pre-release versions must use semver e.g. as of 20221220, it's '1.20.0-rc.1'
# TODO: add this back once we resolve the issue with go-codec failing on development branch.
#
# We test amd64 on all releases, and i386 (32-bit) on last production release.
#
# We previously had each tag be its own matrix, but that exploded the number of runs.
# Instead, since the environment is consistent, we just use a bash script to run through all
# the tags for that run.
#
# Finally, we do a go mod edit -droprequire github.com/ugorji/go to circumvent the "missing go.sum entry" error.
# We put a requirements cycle with github.com/ugorji/go to allow folks requiring .../ugorji/go in 2019 to work ok.
# Now, everyone should have updated to a go-codec version >= 1.17 or preferably >= 1.2.0.
# Now is a good time to remove that requirements cycle.
#
#
#
#
# --- SCRATCH ---
# coverage:
# if: ${{ always() }}
# needs: [ tests]
# steps:
# - uses: codecov/codecov-action@v3
# directory: ./codec
#
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0 # required for new-from-rev option in .golangci.yml
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

14 changes: 14 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ Fixing `ambiguous import` failure is now as simple as running
go get -u github.com/ugorji/go/codec@latest
```

### Removing requirements cycle in v1.2.8

Unfortunately, due to the requirements cycle noted above, we cannot create a
valid `go.sum` until after the git version tags have been created. This is why
a `go.sum` has not been distributed with these 2 modules above.

To fix that, starting with codec `v1.2.8`, we will remove the requirements cycle.
`github.com/ugorji/go/` will require `github.com/ugorji/go/codec`
but not vice versa. It has been over 3 years since we released `v1.1.7` (in July 2019)
with the requirements cycle to accomodate folks with an older version of
the `github.com/ugorji/go` module. We believe most folks now depend
either directly on the newer `github.com/ugorji/go/codec` module, or
on a newer `github.com/ugorji/go` module.

## Running on GCCGO

You can use [gccgo](https://gcc.gnu.org/onlinedocs/gccgo/) [1](https://golang.org/doc/install/gccgo)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Sourcegraph](https://sourcegraph.com/github.com/ugorji/go/-/badge.svg?v=4)](https://sourcegraph.com/github.com/ugorji/go/-/tree/codec?badge)
[![Build Status](https://travis-ci.org/ugorji/go.svg?branch=master)](https://travis-ci.org/ugorji/go)
[![Build and Test go-codec](https://github.com/ugorji/go/actions/workflows/test.yml/badge.svg)](https://github.com/ugorji/go/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/ugorji/go/branch/master/graph/badge.svg?v=4)](https://codecov.io/gh/ugorji/go)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/ugorji/go/codec)](https://pkg.go.dev/github.com/ugorji/go/codec)
[![Go Reference](https://pkg.go.dev/badge/github.com/ugorji/go/codec.svg)](https://pkg.go.dev/github.com/ugorji/go/codec)
[![rcard](https://goreportcard.com/badge/github.com/ugorji/go/codec?v=4)](https://goreportcard.com/report/github.com/ugorji/go/codec)
[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/ugorji/go/master/LICENSE)

Expand All @@ -19,10 +19,10 @@ It fully supports the legacy `GOPATH` and the new `go modules` modes.

This repository consists of 4 modules:

- `github.com/ugorji/go` (requires `github.com/ugorji/go/codec`)
- `github.com/ugorji/go/codec` (requires `github.com/ugorji/go`) [README](codec/README.md)
- `github.com/ugorji/go/codec` [README](codec/README.md)
- `github.com/ugorji/go/codec/codecgen` (requires `github.com/ugorji/go/codec`) [README](codec/codecgen/README.md)
- `github.com/ugorji/go/codec/bench` (requires `github.com/ugorji/go/codec`) [README](codec/bench/README.md)
- `github.com/ugorji/go` (requires `github.com/ugorji/go/codec`)

For encoding and decoding, the `github.com/ugorji/go/codec` module is sufficient.

Expand All @@ -34,6 +34,6 @@ go get github.com/ugorji/go/codec

The other modules exist for specific uses, and all require `github.com/ugorji/go/codec`

- `github.com/ugorji/go` is here for [historical compatibility reasons, as modules was initially introduced only at repo root](https://github.com/ugorji/go/issues/299)
- `github.com/ugorji/go/codec/codecgen` generates high performance static encoders/decoders for given types
- `github.com/ugorji/go/codec/bench` benchmarks codec against other popular go libraries
- `github.com/ugorji/go` is here for [historical compatibility reasons, as modules was initially introduced only at repo root](https://github.com/ugorji/go/issues/299)
Loading