Fix typo "exitcode" (#3511)

diff --git a/lib/src/command.dart b/lib/src/command.dart
index ae942ea..e86dd50 100644
--- a/lib/src/command.dart
+++ b/lib/src/command.dart
@@ -165,7 +165,7 @@
 
   /// Override the exit code that would normally be used when exiting
   /// successfully. Intended to be used by subcommands like `run` that wishes
-  /// to control the top-level exitcode.
+  /// to control the top-level exit code.
   ///
   /// This may only be called once.
   @nonVirtual
diff --git a/test/golden_file.dart b/test/golden_file.dart
index c4baefe..9db8ad0 100644
--- a/test/golden_file.dart
+++ b/test/golden_file.dart
@@ -149,7 +149,7 @@
       _expectSection(_nextSectionIndex++, actual);
 
   /// Run `pub` [args] with [environment] variables in [workingDirectory], and
-  /// log stdout/stderr and exitcode to golden file.
+  /// log stdout/stderr and exit code to golden file.
   Future<void> run(
     List<String> args, {
     Map<String, String>? environment,