From 7e55ae4ca55fadf8bf72285abbc03d69580deac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 24 May 2021 00:11:58 +0300 Subject: [PATCH] golint --- internal/cmdlxcconfig/cmdlxcconfig.go | 26 ++++++++++++++------------ internal/cmdrootfs/cmdrootfs.go | 26 ++++++++++++++------------ 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/internal/cmdlxcconfig/cmdlxcconfig.go b/internal/cmdlxcconfig/cmdlxcconfig.go index 7511301..ca94825 100644 --- a/internal/cmdlxcconfig/cmdlxcconfig.go +++ b/internal/cmdlxcconfig/cmdlxcconfig.go @@ -12,19 +12,18 @@ import ( const _description = "Create an LXC-compatible container configuration" -type ( - // Command is an implementation of go-flags.Command - Command struct { - configer func(io.ReadSeeker, io.Writer) error - Stdout io.Writer +// Command is an implementation of go-flags.Command +type Command struct { + configer func(io.ReadSeeker, io.Writer) error + Stdout io.Writer - PositionalArgs struct { - Infile goflags.Filename `long:"infile" description:"Input tarball"` - Outfile string `long:"outfile" description:"Output path, stdout is '-'"` - } `positional-args:"yes" required:"yes"` - } -) + PositionalArgs struct { + Infile goflags.Filename `long:"infile" description:"Input tarball"` + Outfile string `long:"outfile" description:"Output path, stdout is '-'"` + } `positional-args:"yes" required:"yes"` +} +// NewCommand creates a new Command struct func NewCommand() *Command { return &Command{ configer: lxcconfig.LXCConfig, @@ -32,8 +31,11 @@ func NewCommand() *Command { } } +// ShortDesc returns the command's short description func (*Command) ShortDesc() string { return _description } -func (*Command) LongDesc() string { return _description } + +// LongDesc returns the command's long description +func (*Command) LongDesc() string { return _description } // Execute executes lxcconfig Command func (c *Command) Execute(args []string) (err error) { diff --git a/internal/cmdrootfs/cmdrootfs.go b/internal/cmdrootfs/cmdrootfs.go index ed72215..a136165 100644 --- a/internal/cmdrootfs/cmdrootfs.go +++ b/internal/cmdrootfs/cmdrootfs.go @@ -12,19 +12,18 @@ import ( const _description = "Flatten a docker container image to a tarball" -type ( - // Command is an implementation of go-flags.Command - Command struct { - flattener func(io.ReadSeeker, io.Writer) error - Stdout io.Writer +// Command is an implementation of go-flags.Command +type Command struct { + flattener func(io.ReadSeeker, io.Writer) error + Stdout io.Writer - PositionalArgs struct { - Infile goflags.Filename `long:"infile" desc:"Input tarball"` - Outfile string `long:"outfile" desc:"Output path, stdout is '-'"` - } `positional-args:"yes" required:"yes"` - } -) + PositionalArgs struct { + Infile goflags.Filename `long:"infile" desc:"Input tarball"` + Outfile string `long:"outfile" desc:"Output path, stdout is '-'"` + } `positional-args:"yes" required:"yes"` +} +// NewCommand creates a new Command struct func NewCommand() *Command { return &Command{ flattener: rootfs.Flatten, @@ -32,8 +31,11 @@ func NewCommand() *Command { } } +// ShortDesc returns the command's short description func (*Command) ShortDesc() string { return _description } -func (*Command) LongDesc() string { return _description } + +// LongDesc returns the command's long description +func (*Command) LongDesc() string { return _description } // Execute executes rootfs Command func (c *Command) Execute(args []string) (err error) {