Skip to content

Modernize CI and docs for Go 1.25#23

Merged
kelindar merged 2 commits into
masterfrom
tests
Jul 20, 2026
Merged

Modernize CI and docs for Go 1.25#23
kelindar merged 2 commits into
masterfrom
tests

Conversation

@kelindar

Copy link
Copy Markdown
Owner

Summary

  • Bump the module (and bench module) to Go 1.25
  • Align GitHub Actions with the tales-style pipeline: coverage, gocognit, Coveralls, and PR diff-cover
  • Expand the README with detailed custom serialization docs (MarshalBinary / GetBinaryCodec) and full benchmark results
  • Clean up testlint hygiene (table tests, file pairing) and split scanType to stay under the cognitive-complexity limit

Test plan

  • go test ./... passes on Go 1.25
  • cd bench && go test . passes
  • CI workflow runs successfully (coverage upload + gocognit)
  • Spot-check README custom serialization examples against the Codec / BinaryMarshaler APIs

Made with Cursor

Bump the module to Go 1.25, align the GitHub Actions workflow with the
tales coverage/gocognit pipeline, and expand the README with custom
serialization docs and full bench results. Also clean up testlint
hygiene and split scanType so cognitive complexity stays under the
CI limit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
89.0%

passed

██████████████████░░89.0% on changed lines

336 lines changed   35 uncovered   3 files

 📂 3 files changed
File Coverage Uncovered Lines
🟡 scanner.go 85.7% 78, 85, 86, 93, 94, 146, 147, 150, 151, 173 (+1 more)

| 🟡 | nocopy/types.go | 89.8% | 54, 55, 56, 71, 72, 73, 88, 89, 90, 105 (+14 more) |

| 🟢 | unsafe/types.go | 100.0% | — |

 📋 Full diff-cover report

Diff Coverage

Diff: origin/master...HEAD, staged and unstaged changes

  • nocopy/types.go (89.8%): Missing lines 54-56,71-73,88-90,105-107,122-124,139-141,156-158,173-175
  • scanner.go (85.7%): Missing lines 78,85-86,93-94,146-147,150-151,173-174
  • unsafe/types.go (100%)

Summary

  • Total: 336 lines
  • Missing: 35 lines
  • Coverage: 89%

nocopy/types.go

  50 
  51 // Uint16s represents a slice serialized in an unsafe, non portable manner.
  52 type Uint16s []uint16
  53 
! 54 func (s Uint16s) Len() int           { return len(s) }
! 55 func (s Uint16s) Less(i, j int) bool { return s[i] < s[j] }
! 56 func (s Uint16s) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
  57 
  58 // GetBinaryCodec retrieves a custom binary codec.
  59 func (s *Uint16s) GetBinaryCodec() binary.Codec {
  60 	return &integerSliceCodec{

  67 
  68 // Int16s represents a slice serialized in an unsafe, non portable manner.
  69 type Int16s []int16
  70 
! 71 func (s Int16s) Len() int           { return len(s) }
! 72 func (s Int16s) Less(i, j int) bool { return s[i] < s[j] }
! 73 func (s Int16s) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
  74 
  75 // GetBinaryCodec retrieves a custom binary codec.
  76 func (s *Int16s) GetBinaryCodec() binary.Codec {
  77 	return &integerSliceCodec{

  84 
  85 // Uint32s represents a slice serialized in an unsafe, non portable manner.
  86 type Uint32s []uint32
  87 
! 88 func (s Uint32s) Len() int           { return len(s) }
! 89 func (s Uint32s) Less(i, j int) bool { return s[i] < s[j] }
! 90 func (s Uint32s) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
  91 
  92 // GetBinaryCodec retrieves a custom binary codec.
  93 func (s *Uint32s) GetBinaryCodec() binary.Codec {
  94 	return &integerSliceCodec{

  101 
  102 // Int32s represents a slice serialized in an unsafe, non portable manner.
  103 type Int32s []int32
  104 
! 105 func (s Int32s) Len() int           { return len(s) }
! 106 func (s Int32s) Less(i, j int) bool { return s[i] < s[j] }
! 107 func (s Int32s) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
  108 
  109 // GetBinaryCodec retrieves a custom binary codec.
  110 func (s *Int32s) GetBinaryCodec() binary.Codec {
  111 	return &integerSliceCodec{

  118 
  119 // Uint64s represents a slice serialized in an unsafe, non portable manner.
  120 type Uint64s []uint64
  121 
! 122 func (s Uint64s) Len() int           { return len(s) }
! 123 func (s Uint64s) Less(i, j int) bool { return s[i] < s[j] }
! 124 func (s Uint64s) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
  125 
  126 // GetBinaryCodec retrieves a custom binary codec.
  127 func (s *Uint64s) GetBinaryCodec() binary.Codec {
  128 	return &integerSliceCodec{

  135 
  136 // Int64s represents a slice serialized in an unsafe, non portable manner.
  137 type Int64s []int64
  138 
! 139 func (s Int64s) Len() int           { return len(s) }
! 140 func (s Int64s) Less(i, j int) bool { return s[i] < s[j] }
! 141 func (s Int64s) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
  142 
  143 // GetBinaryCodec retrieves a custom binary codec.
  144 func (s *Int64s) GetBinaryCodec() binary.Codec {
  145 	return &integerSliceCodec{

  152 
  153 // Float32s represents a slice serialized in an unsafe, non portable manner.
  154 type Float32s []float32
  155 
! 156 func (s Float32s) Len() int           { return len(s) }
! 157 func (s Float32s) Less(i, j int) bool { return s[i] < s[j] }
! 158 func (s Float32s) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
  159 
  160 // GetBinaryCodec retrieves a custom binary codec.
  161 func (s *Float32s) GetBinaryCodec() binary.Codec {
  162 	return &integerSliceCodec{

  169 
  170 // Float64s represents a slice serialized in an unsafe, non portable manner.
  171 type Float64s []float64
  172 
! 173 func (s Float64s) Len() int           { return len(s) }
! 174 func (s Float64s) Less(i, j int) bool { return s[i] < s[j] }
! 175 func (s Float64s) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
  176 
  177 // GetBinaryCodec retrieves a custom binary codec.
  178 func (s *Float64s) GetBinaryCodec() binary.Codec {
  179 	return &integerSliceCodec{

scanner.go

  74 	default:
  75 		if c := scanPrimitive(t.Kind()); c != nil {
  76 			return c, nil
  77 		}
! 78 		return nil, errors.New("binary: unsupported type " + t.String())
  79 	}
  80 }
  81 
  82 func scanPointer(t reflect.Type) (Codec, error) {

  81 
  82 func scanPointer(t reflect.Type) (Codec, error) {
  83 	elemCodec, err := scanType(t.Elem())
  84 	if err != nil {
! 85 		return nil, err
! 86 	}
  87 	return &reflectPointerCodec{elemCodec: elemCodec}, nil
  88 }
  89 
  90 func scanArray(t reflect.Type) (Codec, error) {

  89 
  90 func scanArray(t reflect.Type) (Codec, error) {
  91 	elemCodec, err := scanType(t.Elem())
  92 	if err != nil {
! 93 		return nil, err
! 94 	}
  95 	return &reflectArrayCodec{elemCodec: elemCodec}, nil
  96 }
  97 
  98 func scanSlice(t reflect.Type) (Codec, error) {

  142 
  143 func scanMap(t reflect.Type) (Codec, error) {
  144 	key, err := scanType(t.Key())
  145 	if err != nil {
! 146 		return nil, err
! 147 	}
  148 	val, err := scanType(t.Elem())
  149 	if err != nil {
! 150 		return nil, err
! 151 	}
  152 	return &reflectMapCodec{key: key, val: val}, nil
  153 }
  154 
  155 func scanPrimitive(kind reflect.Kind) Codec {

  169 	case reflect.Float32:
  170 		return new(float32Codec)
  171 	case reflect.Float64:
  172 		return new(float64Codec)
! 173 	default:
! 174 		return nil
  175 	}
  176 }
  177 
  178 type scannedStruct struct {

🛡️ diff-cover-action

Cognitive complexity checks aren't needed for this library.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coveralls

coveralls commented Jul 20, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29770624292

Coverage decreased (-0.1%) to 91.918%

Details

  • Coverage decreased (-0.1%) from the base build.
  • Patch coverage: 35 uncovered changes across 2 files (301 of 336 lines covered, 89.58%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
nocopy/types.go 235 211 89.79%
scanner.go 77 66 85.71%
Total (3 files) 336 301 89.58%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1559
Covered Lines: 1433
Line Coverage: 91.92%
Coverage Strength: 607.66 hits per line

💛 - Coveralls

@kelindar
kelindar merged commit 1605cf8 into master Jul 20, 2026
1 check passed
@kelindar
kelindar deleted the tests branch July 20, 2026 19:08
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.

2 participants