func cmdFileMain() {
	fmt.Println("start worker")
	cmd := exec.Command("python", "test.py")
	f, _ := os.OpenFile("log.log", os.O_APPEND|os.O_WRONLY, 750)
	cmd.Stdout = f
	cmd.Run()
}
StartWorker to start this agent as worker
package main
import (
	"errors"
	"fmt"
	"io"
	"log"
	"os"
	"os/exec"
	"strconv"
	"time"
	"github.com/golang/protobuf/proto"
	"github.com/wecatch/devops-ui/pbmessage"
	"github.com/StabbyCutyou/buffstreams"
	xlog "github.com/apex/log"
	"github.com/apex/log/handlers/text"
	scmd "github.com/go-cmd/cmd"
	"github.com/sirupsen/logrus"
	"github.com/xanzy/go-gitlab"
)
func gitlabMain() {
	client := gitlab.NewClient(nil, "Ay3qMksYxKZjLGXeWsHF")
	client.SetBaseURL("http://git.shequan.com/")
	opt := &gitlab.ListProjectsOptions{
		Sort:       gitlab.String("asc"),
		Membership: gitlab.Bool(true),
	}
	projects, _, err := client.Projects.ListProjects(opt)
	if err != nil {
		fmt.Println(err)
	}
	for _, project := range projects {
		fmt.Println(project.WebURL)
		fmt.Println(project.Name)
		fmt.Println("======")
	}
}
type writer int
func (*writer) Write(p []byte) (int, error) {
	fmt.Println("out", len(p))  
	return len(p), nil
}
func main() {
	var s []string
	for _, h := range []string{"1", "2", "3", "4", "5", "6", "7", "8", "9"} {
		s = append(s, h)
	}
	fmt.Printf("%T", len(s))
	fmt.Println("s ", s)
	fmt.Println("s cap ", cap(s))
	fmt.Println("s length ", len(s))
	ss := s[0:5]
	fmt.Println("ss ", ss)
	fmt.Println("ss cap ", cap(ss))
	fmt.Println("ss length ", len(ss))
	s = s[5:]
	fmt.Println("s ", s)
	fmt.Println("s cap ", cap(s))
	fmt.Println("s length ", len(s))
	ss = s[0:5]  
	fmt.Println("ss ", ss)
	fmt.Println("ss cap ", cap(ss))
	fmt.Println("ss length ", len(ss))
	s = s[4:]
	fmt.Println("s ", s)
	fmt.Println("s cap ", cap(s))
	fmt.Println("s length ", len(s))
	var y []int
	for i := 0; i < 10; i++ {
		y = append(y, i)
		fmt.Printf("%d cap=%d\t%v\n", i, cap(y), y)
	}
}