diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3938344..2fccaad 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,10 @@ version: 2 updates: - - package-ecosystem: "gomod" - directory: "/" + - package-ecosystem: gomod + directory: / schedule: - interval: "daily" + interval: daily + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9e6b4f2..23cac1b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -5,21 +5,30 @@ on: branches: [ main ] pull_request: branches: [ main ] + schedule: + - cron: "0 0 * * MON" + workflow_dispatch: jobs: test: - runs-on: ubuntu-latest + strategy: + matrix: + go: [ oldstable, stable ] + os: [ ubuntu-latest, macos-latest, windows-latest ] + runs-on: ${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up Go + - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v3 with: - go-version-file: go.mod + go-version: ${{ matrix.go }} - name: Run tests - run: go test -race -coverprofile=coverage.out ./... + # do not use `=` to join flags and values, it won't work on Windows; + # see https://github.com/PowerShell/PowerShell/issues/6291 for details. + run: go test -v -race -shuffle on -coverprofile coverage.out ./... - name: Upload coverage uses: codecov/codecov-action@v3 diff --git a/musttag_test.go b/musttag_test.go index c7ad37f..cbcf43b 100644 --- a/musttag_test.go +++ b/musttag_test.go @@ -12,9 +12,9 @@ import ( ) func TestAnalyzer(t *testing.T) { - // NOTE(junk1tm): analysistest does not yet support modules - // (see https://github.com/golang/go/issues/37054 for details). - // So, to be able to run tests with external dependencies, + // NOTE(junk1tm): analysistest does not yet support modules; + // see https://github.com/golang/go/issues/37054 for details. + // To be able to run tests with external dependencies, // we first need to write a GOPATH-like tree of stubs. prepareTestFiles(t) testPackages = []string{"tests", "builtins"} diff --git a/testdata/builtins.go b/testdata/builtins.go index 98c8fae..b62be95 100644 --- a/testdata/builtins.go +++ b/testdata/builtins.go @@ -12,39 +12,39 @@ import ( ) type User struct { /* want - "`User` should be annotated with the `json` tag as it is passed to `json.Marshal` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `json` tag as it is passed to `json.MarshalIndent` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `json` tag as it is passed to `json.Unmarshal` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `json` tag as it is passed to `json.Encoder.Encode` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `json` tag as it is passed to `json.Decoder.Decode` at testdata/src/builtins/builtins.go" + "`User` should be annotated with the `json` tag as it is passed to `json.Marshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `json` tag as it is passed to `json.MarshalIndent` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `json` tag as it is passed to `json.Unmarshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `json` tag as it is passed to `json.Encoder.Encode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `json` tag as it is passed to `json.Decoder.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" - "`User` should be annotated with the `xml` tag as it is passed to `xml.Marshal` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `xml` tag as it is passed to `xml.MarshalIndent` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `xml` tag as it is passed to `xml.Unmarshal` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `xml` tag as it is passed to `xml.Encoder.Encode` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `xml` tag as it is passed to `xml.Decoder.Decode` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `xml` tag as it is passed to `xml.Encoder.EncodeElement` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `xml` tag as it is passed to `xml.Decoder.DecodeElement` at testdata/src/builtins/builtins.go" + "`User` should be annotated with the `xml` tag as it is passed to `xml.Marshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `xml` tag as it is passed to `xml.MarshalIndent` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `xml` tag as it is passed to `xml.Unmarshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `xml` tag as it is passed to `xml.Encoder.Encode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `xml` tag as it is passed to `xml.Decoder.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `xml` tag as it is passed to `xml.Encoder.EncodeElement` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `xml` tag as it is passed to `xml.Decoder.DecodeElement` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" - "`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Marshal` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Unmarshal` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Encoder.Encode` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Decoder.Decode` at testdata/src/builtins/builtins.go" + "`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Marshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Unmarshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Encoder.Encode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Decoder.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" - "`User` should be annotated with the `toml` tag as it is passed to `toml.Unmarshal` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `toml` tag as it is passed to `toml.Decode` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `toml` tag as it is passed to `toml.DecodeFS` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `toml` tag as it is passed to `toml.DecodeFile` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `toml` tag as it is passed to `toml.Encoder.Encode` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `toml` tag as it is passed to `toml.Decoder.Decode` at testdata/src/builtins/builtins.go" + "`User` should be annotated with the `toml` tag as it is passed to `toml.Unmarshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `toml` tag as it is passed to `toml.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `toml` tag as it is passed to `toml.DecodeFS` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `toml` tag as it is passed to `toml.DecodeFile` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `toml` tag as it is passed to `toml.Encoder.Encode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `toml` tag as it is passed to `toml.Decoder.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" - "`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.Decode` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.DecodeMetadata` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.WeakDecode` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.WeakDecodeMetadata` at testdata/src/builtins/builtins.go" + "`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.DecodeMetadata` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.WeakDecode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.WeakDecodeMetadata` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" - "`User` should be annotated with the `custom` tag as it is passed to `custom.Marshal` at testdata/src/builtins/builtins.go" - "`User` should be annotated with the `custom` tag as it is passed to `custom.Unmarshal` at testdata/src/builtins/builtins.go" + "`User` should be annotated with the `custom` tag as it is passed to `custom.Marshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" + "`User` should be annotated with the `custom` tag as it is passed to `custom.Unmarshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go" */ Name string Email string `json:"email" xml:"email" yaml:"email" toml:"email" mapstructure:"email" custom:"email"`