Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nikolaydubina/go-enum-encoding
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.4.1
Choose a base ref
...
head repository: nikolaydubina/go-enum-encoding
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.5.0
Choose a head ref
  • 9 commits
  • 15 files changed
  • 2 contributors

Commits on May 28, 2024

  1. iota

    nikolaydubina committed May 28, 2024
    Configuration menu
    Copy the full SHA
    ef0efe0 View commit details
    Browse the repository at this point in the history
  2. Iota example (#23)

    * iota
    
    * iota-example
    
    * clean
    nikolaydubina authored May 28, 2024
    Configuration menu
    Copy the full SHA
    6055f6d View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2024

  1. Validate the enum type matches the -type arg

    Without validation, multiple definitions of multiple enums in the same file
    would be mixed, as well as comments with `json:"..."` on `val` or `const`
    statments.
    
    Fixes #24
    orenl committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    fc0efcf View commit details
    Browse the repository at this point in the history
  2. Improve matching of enum type, abort when unable to match

    Detect type when explicitly available. Infer when implicity known via a
    composite type (of the first enum value). Punt with warning when neither
    is possible (i.e. when type not explicitly stated, and value is literal
    or expression). Exit with error when type canont be matched.
    
    Fixes #24
    orenl committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    90d037f View commit details
    Browse the repository at this point in the history
  3. Match enum values based on location of #go:generate comment

    The `const`/`var` block is expected to be found in the line immediately
    subsequent to that of the `#go:generate`. Use the latter to precisely
    locate the relevant block. This significantly simplified the solution
    to the original issue.
    
    Fixes #24
    orenl committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    9c20d9d View commit details
    Browse the repository at this point in the history
  4. Add tests for multiple enums in one file and missing enums

    Add the env variable GOLINE=..., needed to vet the relevant const/var block.
    
    Add a test case with multiple enum definition in the same file.
    
    Add a test case to expect an error when the const/var block is not found in
    the line following the `//go:generate ...` comment.
    
    Remove unneeded output files from internal/testdata (uneeded copies of the
    same files in internal/testdata/exp).
    orenl committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    121a512 View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2024

  1. Update main.go

    Signed-off-by: Nikolay Dubina <nikolay.dubina.pub@gmail.com>
    nikolaydubina authored Aug 20, 2024
    Configuration menu
    Copy the full SHA
    151c886 View commit details
    Browse the repository at this point in the history
  2. revert-files

    nikolaydubina committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    aaa4957 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dce6cc1 View commit details
    Browse the repository at this point in the history
Loading