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

Fix: goheader linter can throw nil pointer exception in case of a source file has not issues #1209

Conversation

denis-tingaikin
Copy link
Member

@denis-tingaikin denis-tingaikin commented Jul 5, 2020

Description

During local testing latest golangci, we've found that go-header linter can throw nil pointer exception in case of a source file is valid.

What is this patch doing?

  • Fix issue.
  • Add test to cover.
  • Allow using empty new lines in testdata/.*\.go files.

Steps to reproduce the issue

  1. Use next go-header config
linters-settings:
  goheader:
    template: "test"
  1. Run golangci linter on file with valid header, for example
//test

//Package mypkg ...
package mypkg

Actual: nil pointer exception
Expected: Template has matched no issues should be found

@denis-tingaikin
Copy link
Member Author

Here is failed one check that is fixed in #1207

Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com>
Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com>
@denis-tingaikin denis-tingaikin force-pushed the fix_potential_nil_pointer_for_goheader branch from 6e3e924 to e2c0d60 Compare July 5, 2020 08:08
@denis-tingaikin denis-tingaikin merged commit dfa0013 into golangci:master Jul 5, 2020
@denis-tingaikin
Copy link
Member Author

@sayboras, @iwankgb, I interested to release a new version with this patch dfa0013, Do you have any idea what I need to do? :)

@iwankgb
Copy link
Contributor

iwankgb commented Jul 6, 2020

This is bugfix release so:

@denis-tingaikin
Copy link
Member Author

@iwankgb thanks! Done! Also I got a question where we should put generated docs/.*mdx files?

@iwankgb
Copy link
Contributor

iwankgb commented Jul 6, 2020

@denis-tingajkin I don't think I understand what you mean. mdx files gets published automatically to the docs site.

@denis-tingaikin
Copy link
Member Author

@iwankgb I meant generated files after make expand_website_templates. Should I also create PR to the website repository?

@ldez ldez added this to the v1.28 milestone Mar 6, 2024
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.

None yet

4 participants