wip constructors
This commit is contained in:
8
internal/cmd/BUILD
Normal file
8
internal/cmd/BUILD
Normal file
@@ -0,0 +1,8 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["cmd.go"],
|
||||
importpath = "github.com/motiejus/code/undocker/internal/cmd",
|
||||
visibility = ["//src/undocker:__subpackages__"],
|
||||
)
|
||||
20
internal/cmd/cmd.go
Normal file
20
internal/cmd/cmd.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
// BaseCommand provides common fields to all commands.
|
||||
type BaseCommand struct {
|
||||
Stdin io.ReadCloser
|
||||
Stdout io.WriteCloser
|
||||
Stderr io.WriteCloser
|
||||
}
|
||||
|
||||
// Init initializes BaseCommand with default arguments
|
||||
func (b *BaseCommand) Init() {
|
||||
b.Stdin = os.Stdin
|
||||
b.Stdout = os.Stdout
|
||||
b.Stderr = os.Stderr
|
||||
}
|
||||
Reference in New Issue
Block a user