Skip to content

Commit 82fbb84

Browse files
committed
fmt: applies go1.19 fmt
1 parent 849e047 commit 82fbb84

File tree

12 files changed

+131
-135
lines changed

12 files changed

+131
-135
lines changed

config/config.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ func Path(configroot, extension string) (string, error) {
7878
// Filename returns the configuration file path given a configuration root
7979
// directory and a user-provided configuration file path argument with the
8080
// following rules:
81-
// * If the user-provided configuration file path is empty, use the default one.
82-
// * If the configuration root directory is empty, use the default one.
83-
// * If the user-provided configuration file path is only a file name, use the
84-
// configuration root directory, otherwise use only the user-provided path
85-
// and ignore the configuration root.
81+
// - If the user-provided configuration file path is empty, use the default one.
82+
// - If the configuration root directory is empty, use the default one.
83+
// - If the user-provided configuration file path is only a file name, use the
84+
// configuration root directory, otherwise use only the user-provided path
85+
// and ignore the configuration root.
8686
func Filename(configroot string, userConfigFile string) (string, error) {
8787
if userConfigFile == "" {
8888
return Path(configroot, DefaultConfigFile)

core/commands/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ Set the value of the 'Datastore.Path' key:
152152
// A pattern matches a part if and only if the pattern is "*" or the lowercase pattern equals the lowercase part.
153153
//
154154
// For example:
155+
//
155156
// matchesGlobPrefix("foo.bar", []string{"*", "bar", "baz"}) returns true
156157
// matchesGlobPrefix("foo.bar.baz", []string{"*", "bar"}) returns true
157158
// matchesGlobPrefix("foo.bar", []string{"baz", "*"}) returns false

core/core.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Packages underneath core/ provide a (relatively) stable, low-level API
55
to carry out most IPFS-related tasks. For more details on the other
66
interfaces and how core/... fits into the bigger IPFS picture, see:
77
8-
$ godoc github.com/ipfs/go-ipfs
8+
$ godoc github.com/ipfs/go-ipfs
99
*/
1010
package core
1111

core/node/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func maybeProvide(opt interface{}, enable bool) fx.Option {
4343
return fx.Options()
4444
}
4545

46-
//nolint unused
46+
// nolint unused
4747
func maybeInvoke(opt interface{}, enable bool) fx.Option {
4848
if enable {
4949
return fx.Invoke(opt)

plugin/loader/loader.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ func (ls loaderState) String() string {
7979
// PluginLoader keeps track of loaded plugins.
8080
//
8181
// To use:
82-
// 1. Load any desired plugins with Load and LoadDirectory. Preloaded plugins
83-
// will automatically be loaded.
84-
// 2. Call Initialize to run all initialization logic.
85-
// 3. Call Inject to register the plugins.
86-
// 4. Optionally call Start to start plugins.
87-
// 5. Call Close to close all plugins.
82+
// 1. Load any desired plugins with Load and LoadDirectory. Preloaded plugins
83+
// will automatically be loaded.
84+
// 2. Call Initialize to run all initialization logic.
85+
// 3. Call Inject to register the plugins.
86+
// 4. Optionally call Start to start plugins.
87+
// 5. Call Close to close all plugins.
8888
type PluginLoader struct {
8989
state loaderState
9090
plugins map[string]plugin.Plugin

plugin/plugins/peerlog/peerlog.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ type plEvent struct {
3939
// Log all the PeerIDs. This is considered internal, unsupported, and may break at any point.
4040
//
4141
// Usage:
42-
// GOLOG_FILE=~/peer.log IPFS_LOGGING_FMT=json ipfs daemon
42+
//
43+
// GOLOG_FILE=~/peer.log IPFS_LOGGING_FMT=json ipfs daemon
44+
//
4345
// Output:
44-
// {"level":"info","ts":"2020-02-10T13:54:26.639Z","logger":"plugin/peerlog","caller":"peerlog/peerlog.go:51","msg":"connected","peer":"QmS2H72gdrekXJggGdE9SunXPntBqdkJdkXQJjuxcH8Cbt"}
45-
// {"level":"info","ts":"2020-02-10T13:54:59.095Z","logger":"plugin/peerlog","caller":"peerlog/peerlog.go:56","msg":"identified","peer":"QmS2H72gdrekXJggGdE9SunXPntBqdkJdkXQJjuxcH8Cbt","agent":"go-ipfs/0.5.0/"}
4646
//
47+
// {"level":"info","ts":"2020-02-10T13:54:26.639Z","logger":"plugin/peerlog","caller":"peerlog/peerlog.go:51","msg":"connected","peer":"QmS2H72gdrekXJggGdE9SunXPntBqdkJdkXQJjuxcH8Cbt"}
48+
// {"level":"info","ts":"2020-02-10T13:54:59.095Z","logger":"plugin/peerlog","caller":"peerlog/peerlog.go:56","msg":"identified","peer":"QmS2H72gdrekXJggGdE9SunXPntBqdkJdkXQJjuxcH8Cbt","agent":"go-ipfs/0.5.0/"}
4749
type peerLogPlugin struct {
4850
enabled bool
4951
droppedCount uint64

repo/fsrepo/doc.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
//
33
// TODO explain the package roadmap...
44
//
5-
// .ipfs/
6-
// ├── client/
7-
// | ├── client.lock <------ protects client/ + signals its own pid
8-
// │ ├── ipfs-client.cpuprof
9-
// │ └── ipfs-client.memprof
10-
// ├── config
11-
// ├── daemon/
12-
// │ ├── daemon.lock <------ protects daemon/ + signals its own address
13-
// │ ├── ipfs-daemon.cpuprof
14-
// │ └── ipfs-daemon.memprof
15-
// ├── datastore/
16-
// ├── repo.lock <------ protects datastore/ and config
17-
// └── version
5+
// .ipfs/
6+
// ├── client/
7+
// | ├── client.lock <------ protects client/ + signals its own pid
8+
// │ ├── ipfs-client.cpuprof
9+
// │ └── ipfs-client.memprof
10+
// ├── config
11+
// ├── daemon/
12+
// │ ├── daemon.lock <------ protects daemon/ + signals its own address
13+
// │ ├── ipfs-daemon.cpuprof
14+
// │ └── ipfs-daemon.memprof
15+
// ├── datastore/
16+
// ├── repo.lock <------ protects datastore/ and config
17+
// └── version
1818
package fsrepo
1919

2020
// TODO prevent multiple daemons from running

repo/fsrepo/fsrepo.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -582,17 +582,17 @@ func (r *FSRepo) BackupConfig(prefix string) (string, error) {
582582
// SetConfig updates the FSRepo's config. The user must not modify the config
583583
// object after calling this method.
584584
// FIXME: There is an inherent contradiction with storing non-user-generated
585-
// Go config.Config structures as user-generated JSON nested maps. This is
586-
// evidenced by the issue of `omitempty` property of fields that aren't defined
587-
// by the user and Go still needs to initialize them to its default (which
588-
// is not reflected in the repo's config file, see
589-
// https://github.com/ipfs/kubo/issues/8088 for more details).
590-
// In general we should call this API with a JSON nested maps as argument
591-
// (`map[string]interface{}`). Many calls to this function are forced to
592-
// synthesize the config.Config struct from their available JSON map just to
593-
// satisfy this (causing incompatibilities like the `omitempty` one above).
594-
// We need to comb SetConfig calls and replace them when possible with a
595-
// JSON map variant.
585+
// Go config.Config structures as user-generated JSON nested maps. This is
586+
// evidenced by the issue of `omitempty` property of fields that aren't defined
587+
// by the user and Go still needs to initialize them to its default (which
588+
// is not reflected in the repo's config file, see
589+
// https://github.com/ipfs/kubo/issues/8088 for more details).
590+
// In general we should call this API with a JSON nested maps as argument
591+
// (`map[string]interface{}`). Many calls to this function are forced to
592+
// synthesize the config.Config struct from their available JSON map just to
593+
// satisfy this (causing incompatibilities like the `omitempty` one above).
594+
// We need to comb SetConfig calls and replace them when possible with a
595+
// JSON map variant.
596596
func (r *FSRepo) SetConfig(updated *config.Config) error {
597597

598598
// packageLock is held to provide thread-safety.

repo/fsrepo/migrations/fetch.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var DownloadDirectory string
2626
// is needed because the archive "go-ipfs_v0.7.0_linux-amd64.tar.gz" contains a
2727
// binary named "ipfs"
2828
//
29-
// FetchBinary(ctx, fetcher, "go-ipfs", "v0.7.0", "ipfs", tmpDir)
29+
// FetchBinary(ctx, fetcher, "go-ipfs", "v0.7.0", "ipfs", tmpDir)
3030
//
3131
// If out is a directory, then the binary is written to that directory with the
3232
// same name it has inside the archive. Otherwise, the binary file is written
@@ -178,9 +178,9 @@ func osWithVariant() (string, error) {
178178
// Returns the archive path and the base name.
179179
//
180180
// The ipfs path format is: distribution/version/archiveName
181-
// - distribution is the name of a distribution, such as "go-ipfs"
182-
// - version is the version to fetch, such as "v0.8.0-rc2"
183-
// - archiveName is formatted as name_version_osv-GOARCH.atype, such as
181+
// - distribution is the name of a distribution, such as "go-ipfs"
182+
// - version is the version to fetch, such as "v0.8.0-rc2"
183+
// - archiveName is formatted as name_version_osv-GOARCH.atype, such as
184184
// "go-ipfs_v0.8.0-rc2_linux-amd64.tar.gz"
185185
//
186186
// This would form the path:

repo/onlyone.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ type OnlyOne struct {
1919
// that are unique across different concrete Repo implementations,
2020
// e.g. by creating a local type:
2121
//
22-
// type repoKey string
23-
// r, err := o.Open(repoKey(path), open)
22+
// type repoKey string
23+
// r, err := o.Open(repoKey(path), open)
2424
//
2525
// Call Repo.Close when done.
2626
func (o *OnlyOne) Open(key interface{}, open func() (Repo, error)) (Repo, error) {

0 commit comments

Comments
 (0)