git-lfs/config
Chris Darroch 2830d39ef4 avoid extra message format parsing where possible
Because the tr.Tr.Get() family of methods insert arguments
into printf(3)-style format strings after translating the
format string, we can in a few cases drop a surrounding call
to fmt.Sprintf() or a similar method, as those now take no
arguments and so are redundant.

Moreover, this will help us avoid situations where either
the translated string or the argument values interpolated
by tr.Tr.Get() produce an output string which itself happens
to contain character sequences that resemble Go format
specifiers (e.g., "%s", "%d", etc.)  In such cases passing the
string at runtime to a method such as fmt.Fprintf() will result
in the output containing a warning such as "%!s(MISSING)", which
is not ideal.

Note that in one case, in lfs/attribute.go, we can now also
simplify the format string to use standard format specifiers
instead of double-escaped ones (e.g., "%%q") since we can just
allow tr.Tr.Get() to do the interpolation.

We also take the opportunity to remove explicit leading or
trailing newlines from translation messages wherever it is
possible to convert the surrounding call to fmt.Print(),
fmt.Fprint(), fmt.Println(), or fmt.Fprintln().

Finally, in the commands/run.go file, we can replace two calls
to fmt.Fprintf() with fmt.Println() because they are just
printing output to os.Stdout, not os.Stderr, and in the
lfs/extension.go file, we can make better use of fmt.Errorf().

Note that at least one of these messages is not yet actually
passed as a translation string, but we will address that issue
in a subsequent commit.
2022-01-29 22:32:58 -08:00
..
config_test.go Set package version to v3 2021-09-02 20:41:08 +00:00
config.go avoid extra message format parsing where possible 2022-01-29 22:32:58 -08:00
delayed_environment.go Fix typos 2022-01-05 08:49:08 +02:00
environment_test.go Set package version to v3 2021-09-02 20:41:08 +00:00
environment.go add some godocs 2017-10-27 14:10:46 -06:00
extension_test.go lfs: use github.com/stretchr/testify for assertions 2016-05-25 10:43:10 -06:00
extension.go config: make strings translatable 2022-01-18 17:05:02 +00:00
fetcher.go Fix Typos 2019-07-24 07:17:40 +00:00
git_fetcher_test.go Properly handle config options for URLs with upper case letters 2019-04-02 16:06:14 +00:00
git_fetcher.go config: make strings translatable 2022-01-18 17:05:02 +00:00
map_fetcher.go config,lfsapi: return last element of gitconfig, not first 2017-04-14 13:33:13 -04:00
netrc_nix.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
netrc_windows.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
netrc.go netrc: consider same machine may have different login names 2021-11-04 17:31:37 +08:00
os_fetcher.go Fix Typos 2019-07-24 07:17:40 +00:00
url_config_test.go urlconfig: anchor regexp for key matching 2021-08-30 13:16:27 +00:00
url_config.go urlconfig: anchor regexp for key matching 2021-08-30 13:16:27 +00:00
util_nix.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
util_windows.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
version.go release: v3.0.0 2021-09-13 20:17:50 +00:00