old_contents: import re
  
  from coalib.bearlib.abstractions.Lint import Lint
  from coalib.bears.LocalBear import LocalBear
  
  
  class GoVetBear(LocalBear, Lint):
      executable = 'go'
      arguments = 'vet {filename}'
      output_regex = re.compile(
          r'(?P<file_name>.+):(?P<line>\d+): (?P<message>.*)\n')
      use_stderr = True
  
      def run(self, filename, file):
          '''
          Checks the code using `go vet`.
          '''
          return self.lint(filename)
  
new_contents: from coalib.bearlib.abstractions.Linter import linter
  
  
  @linter(executable='go',
          use_stdout=False,
          use_stderr=True,
          output_format='regex',
          output_regex=r'.+:(?P<line>\d+): (?P<message>.*)')
  class GoVetBear:
      """
      Checks the code using ``go vet``.
      """
  
      @staticmethod
      def create_arguments(filename, file, config_file):
          return 'vet', filename
  
subject: Refactor to Linter v2 API