lint fixes (#14)

* lint fixes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-08-21 14:53:21 +03:00
committed by GitHub
parent 199ff66bd4
commit c4a303190a
42 changed files with 95 additions and 178 deletions

View File

@@ -504,7 +504,7 @@ func (k *kubernetes) Read(opts ...runtime.ReadOption) ([]*runtime.Service, error
return nil, err
}
var services []*runtime.Service
services := make([]*runtime.Service, 0, len(srvs))
for _, service := range srvs {
services = append(services, service.Service)
}

View File

@@ -123,7 +123,7 @@ func (k *klog) Read() ([]runtime.Log, error) {
logParams["tailLines"] = strconv.Itoa(int(k.options.Count))
}
if k.options.Stream == true {
if k.options.Stream {
logParams["follow"] = "true"
}

View File

@@ -443,7 +443,7 @@ func CheckoutSource(folder string, source *Source, secrets map[string]string) er
if !strings.Contains(repo, "https://") {
repo = "https://" + repo
}
err := gitter.Checkout(source.Repo, source.Ref)
err := gitter.Checkout(repo, source.Ref)
if err != nil {
return err
}
@@ -467,10 +467,11 @@ func extractServiceName(fileContent []byte) string {
// Uncompress is a modified version of: https://gist.github.com/mimoo/25fc9716e0f1353791f5908f94d6e726
func Uncompress(src string, dst string) error {
file, err := os.OpenFile(src, os.O_RDWR|os.O_CREATE, 0666)
defer file.Close()
if err != nil {
return err
}
defer file.Close()
// ungzip
zr, err := gzip.NewReader(file)
if err != nil {

View File

@@ -377,7 +377,7 @@ func (r *localRuntime) Logs(s *runtime.Service, options ...runtime.LogsOption) (
t, err := tail.TailFile(fpath, tail.Config{Follow: lopts.Stream, Location: &tail.SeekInfo{
Whence: whence,
Offset: int64(offset),
Offset: offset,
}, Logger: tail.DiscardingLogger})
if err != nil {
return nil, err

View File

@@ -20,7 +20,6 @@ func (p *Process) Exec(exe *process.Binary) error {
}
func (p *Process) Fork(exe *process.Binary) (*process.PID, error) {
// create command
cmd := exec.Command(exe.Package.Path, exe.Args...)