# Path: thefuck/rules/go_unknown_command.py
# @for_app('go')
# def match(command):
#     return 'unknown command' in command.output
# 
# def get_new_command(command):
#     closest_subcommand = get_closest(command.script_parts[1], get_golang_commands())
#     return replace_argument(command.script, command.script_parts[1],
#                             closest_subcommand)
# 
# Path: thefuck/types.py
# class Command(object):
#     """Command that should be fixed."""
# 
#     def __init__(self, script, output):
#         """Initializes command with given values.
# 
#         :type script: basestring
#         :type output: basestring
# 
#         """
#         self.script = script
#         self.output = output
# 
#     @property
#     def stdout(self):
#         logs.warn('`stdout` is deprecated, please use `output` instead')
#         return self.output
# 
#     @property
#     def stderr(self):
#         logs.warn('`stderr` is deprecated, please use `output` instead')
#         return self.output
# 
#     @property
#     def script_parts(self):
#         if not hasattr(self, '_script_parts'):
#             try:
#                 self._script_parts = shell.split_command(self.script)
#             except Exception:
#                 logs.debug(u"Can't split command script {} because:\n {}".format(
#                     self, sys.exc_info()))
#                 self._script_parts = []
# 
#         return self._script_parts
# 
#     def __eq__(self, other):
#         if isinstance(other, Command):
#             return (self.script, self.output) == (other.script, other.output)
#         else:
#             return False
# 
#     def __repr__(self):
#         return u'Command(script={}, output={})'.format(
#             self.script, self.output)
# 
#     def update(self, **kwargs):
#         """Returns new command with replaced fields.
# 
#         :rtype: Command
# 
#         """
#         kwargs.setdefault('script', self.script)
#         kwargs.setdefault('output', self.output)
#         return Command(**kwargs)
# 
#     @classmethod
#     def from_raw_script(cls, raw_script):
#         """Creates instance of `Command` from a list of script parts.
# 
#         :type raw_script: [basestring]
#         :rtype: Command
#         :raises: EmptyCommand
# 
#         """
#         script = format_raw_script(raw_script)
#         if not script:
#             raise EmptyCommand
# 
#         expanded = shell.from_shell(script)
#         output = get_output(script, expanded)
#         return cls(expanded, output)


import pytest
from io import BytesIO
from thefuck.rules.go_unknown_command import match, get_new_command
from thefuck.types import Command
\tfix         update packages to use new APIs
\tfmt         gofmt (reformat) package sources
\tgenerate    generate Go files by processing source
\tget         add dependencies to current module and install them
\tinstall     compile and install packages and dependencies
\tlist        list packages or modules
\tmod         module maintenance
\trun         compile and run Go program
\ttest        test packages
\ttool        run specified go tool
\tversion     print Go version
\tvet         report likely mistakes in packages

Use "go help <command>" for more information about a command.

Additional help topics:

\tbuildconstraint build constraints
\tbuildmode       build modes
\tc               calling between Go and C
\tcache           build and test caching
\tenvironment     environment variables
\tfiletype        file types
\tgo.mod          the go.mod file
\tgopath          GOPATH environment variable
\tgopath-get      legacy GOPATH go get
\tgoproxy         module proxy protocol
\timportpath      import path syntax
\tmodules         modules, module versions, and more
\tmodule-get      module-aware go get

# Path: thefuck/rules/go_unknown_command.py
# @for_app('go')
# def match(command):
#     return 'unknown command' in command.output
# 
# def get_new_command(command):
#     closest_subcommand = get_closest(command.script_parts[1], get_golang_commands())
#     return replace_argument(command.script, command.script_parts[1],
#                             closest_subcommand)
# 
# Path: thefuck/types.py
# class Command(object):
#     """Command that should be fixed."""
# 
#     def __init__(self, script, output):
#         """Initializes command with given values.
# 
#         :type script: basestring
#         :type output: basestring
# 
#         """
#         self.script = script
#         self.output = output
# 
#     @property
#     def stdout(self):
#         logs.warn('`stdout` is deprecated, please use `output` instead')
#         return self.output
# 
#     @property
#     def stderr(self):
#         logs.warn('`stderr` is deprecated, please use `output` instead')
#         return self.output
# 
#     @property
#     def script_parts(self):
#         if not hasattr(self, '_script_parts'):
#             try:
#                 self._script_parts = shell.split_command(self.script)
#             except Exception:
#                 logs.debug(u"Can't split command script {} because:\n {}".format(
#                     self, sys.exc_info()))
#                 self._script_parts = []
# 
#         return self._script_parts
# 
#     def __eq__(self, other):
#         if isinstance(other, Command):
#             return (self.script, self.output) == (other.script, other.output)
#         else:
#             return False
# 
#     def __repr__(self):
#         return u'Command(script={}, output={})'.format(
#             self.script, self.output)
# 
#     def update(self, **kwargs):
#         """Returns new command with replaced fields.
# 
#         :rtype: Command
# 
#         """
#         kwargs.setdefault('script', self.script)
#         kwargs.setdefault('output', self.output)
#         return Command(**kwargs)
# 
#     @classmethod
#     def from_raw_script(cls, raw_script):
#         """Creates instance of `Command` from a list of script parts.
# 
#         :type raw_script: [basestring]
#         :rtype: Command
#         :raises: EmptyCommand
# 
#         """
#         script = format_raw_script(raw_script)
#         if not script:
#             raise EmptyCommand
# 
#         expanded = shell.from_shell(script)
#         output = get_output(script, expanded)
#         return cls(expanded, output)


# Path: tests/rules/test_go_unknown_command.py
import pytest
from io import BytesIO
from thefuck.rules.go_unknown_command import match, get_new_command
from thefuck.types import Command

\tfix         update packages to use new APIs
\tfmt         gofmt (reformat) package sources
\tgenerate    generate Go files by processing source
\tget         add dependencies to current module and install them
\tinstall     compile and install packages and dependencies
\tlist        list packages or modules
\tmod         module maintenance
\trun         compile and run Go program
\ttest        test packages
\ttool        run specified go tool
\tversion     print Go version
\tvet         report likely mistakes in packages

Use "go help <command>" for more information about a command.

Additional help topics:

\tbuildconstraint build constraints
\tbuildmode       build modes
\tc               calling between Go and C
\tcache           build and test caching
\tenvironment     environment variables
\tfiletype        file types
\tgo.mod          the go.mod file
\tgopath          GOPATH environment variable
\tgopath-get      legacy GOPATH go get
\tgoproxy         module proxy protocol
\timportpath      import path syntax
\tmodules         modules, module versions, and more
\tmodule-get      module-aware go get

\tmodule-auth     module authentication using go.sum