Skip to content

chore: upgrade go v1.26#210

Merged
hgiasac merged 5 commits intomainfrom
chore/upgrade-go-v126
Mar 7, 2026
Merged

chore: upgrade go v1.26#210
hgiasac merged 5 commits intomainfrom
chore/upgrade-go-v126

Conversation

@hgiasac
Copy link
Copy Markdown
Collaborator

@hgiasac hgiasac commented Mar 7, 2026

This pull request introduces several improvements and refactors across the connector generation and schema parsing codebase, focusing on code readability, efficiency, and modernization. The most notable changes include replacing custom pointer functions with Go's built-in new, refactoring string building for performance, updating dependencies to Go 1.26, and improving error formatting and type parsing.

Modernization and Dependency Updates

  • Updated the Go version in Dockerfile.tmpl and go.mod.tmpl from 1.25/1.24.12 to 1.26/1.26.1, ensuring compatibility with the latest language features and ecosystem improvements. [1] [2]

Code Generation and Schema Template Improvements

  • Replaced the custom toPtr function with the built-in new for pointer creation in schema templates and testdata, simplifying code and leveraging standard library functionality. [1] [2] [3] [4] [5] [6] [7] [8]

String Building and Parsing Refactors

  • Refactored various string concatenations to use strings.Builder for improved performance and readability, particularly in type name generation and argument formatting. [1] [2] [3]
  • Introduced strings.SplitSeq for splitting enum and type parameter strings, and updated loops to iterate over the resulting sequence, enhancing parsing robustness. [1] [2]

Error Handling and Formatting

  • Improved error formatting for unsupported types and parameter validation, using multi-line fmt.Errorf for clearer error messages. [1] [2] [3]

Code Clean-up and Utility Usage

  • Replaced manual map copying with maps.Copy for flattening embedded object fields, streamlining struct parsing and reducing boilerplate.
  • Minor refactors for readability, such as splitting long lines, consistent formatting, and updating function calls to use variadic arguments. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

These changes collectively enhance maintainability, performance, and code clarity throughout the connector generation and schema parsing modules.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2026

Code Coverage

Package Line Rate Health
github.com/hasura/ndc-codegen-example 98%
github.com/hasura/ndc-codegen-example/functions 63%
github.com/hasura/ndc-codegen-example/types/arguments 43%
github.com/hasura/ndc-codegen-example/types 33%
github.com/hasura/ndc-sdk-go/v2/cmd/hasura-ndc-go/command/internal 84%
github.com/hasura/ndc-sdk-go/v2/cmd/hasura-ndc-go/command 46%
github.com/hasura/ndc-sdk-go/v2/cmd/hasura-ndc-go/version 62%
github.com/hasura/ndc-sdk-go/v2/connector 67%
github.com/hasura/ndc-sdk-go/v2/credentials 75%
github.com/hasura/ndc-sdk-go/v2/example/reference 54%
github.com/hasura/ndc-sdk-go/v2/ndctest 68%
github.com/hasura/ndc-sdk-go/v2/scalar 90%
github.com/hasura/ndc-sdk-go/v2/schema 23%
github.com/hasura/ndc-sdk-go/v2/utils/compression 67%
github.com/hasura/ndc-sdk-go/v2/utils 53%
Summary 47% (12445 / 26712)

Minimum allowed line rate is 40%

@hgiasac hgiasac marked this pull request as ready for review March 7, 2026 09:43
@hgiasac hgiasac merged commit fb83196 into main Mar 7, 2026
2 checks passed
@hgiasac hgiasac deleted the chore/upgrade-go-v126 branch March 7, 2026 09:55
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.

1 participant