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

use sync.OnceValue for various regular expressions, require go1.21 #15

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Commits on Jul 15, 2024

  1. gha: update actions/checkout@v4

    Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
    thaJeztah committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    08b97d2 View commit details
    Browse the repository at this point in the history
  2. gha: update actions/setup-go@v5

    Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
    thaJeztah committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    5291d10 View commit details
    Browse the repository at this point in the history
  3. gha: update golangci/golangci-lint-action@v6

    Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
    thaJeztah committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    92b1472 View commit details
    Browse the repository at this point in the history
  4. gha: update codecov/codecov-action@v4

    Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
    thaJeztah committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    2ab2cce View commit details
    Browse the repository at this point in the history
  5. gha: update golangci-lint to v1.59

        Error: fuzz_test.go:11:14: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
            f.Fuzz(func(t *testing.T, data string) {
                        ^
    
    Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
    thaJeztah committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    0c5e42c View commit details
    Browse the repository at this point in the history
  6. gha: update to go1.21.x, go1.22.x

    Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
    thaJeztah committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    343e590 View commit details
    Browse the repository at this point in the history
  7. use sync.OnceValue for various regular expressions, require go1.21

    Using regex.MustCompile consumes a significant amount of memory when
    importing the package, even if those regular expressions are not used.
    
    This changes compiling the regular expressions to use a sync.OnceValue
    so that they're only compiled the first time they're used.
    
    There are various regular expressions remaining that are still compiled
    on import, but these are exported, so changing them to a sync.OnceValue
    would be a breaking change; we can still decide to do so, but leaving
    that for a follow-up.
    
    It's worth noting that sync.OnceValue requires go1.21 or up, so raising
    the minimum version accordingly.
    
    Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
    thaJeztah committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    4ca1403 View commit details
    Browse the repository at this point in the history