• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang logrus.Debugln函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/Sirupsen/logrus.Debugln函数的典型用法代码示例。如果您正苦于以下问题:Golang Debugln函数的具体用法?Golang Debugln怎么用?Golang Debugln使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Debugln函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: run

func run(c *cli.Context) {
	log.Debugln("[ENVMAN] - Work path:", envman.CurrentEnvStoreFilePath)

	if len(c.Args()) > 0 {
		doCmdEnvs, err := envman.ReadEnvs(envman.CurrentEnvStoreFilePath)
		if err != nil {
			log.Fatal("[ENVMAN] - Failed to load EnvStore:", err)
		}

		doCommand := c.Args()[0]

		doArgs := []string{}
		if len(c.Args()) > 1 {
			doArgs = c.Args()[1:]
		}

		cmdToExecute := CommandModel{
			Command:      doCommand,
			Environments: doCmdEnvs,
			Argumentums:  doArgs,
		}

		log.Debugln("[ENVMAN] - Executing command:", cmdToExecute)

		if exit, err := runCommandModel(cmdToExecute); err != nil {
			log.Error("[ENVMAN] - Failed to execute command:", err)
			os.Exit(exit)
		}

		log.Debugln("[ENVMAN] - Command executed")
	} else {
		log.Fatal("[ENVMAN] - No command specified")
	}
}
开发者ID:bazscsa,项目名称:envman,代码行数:34,代码来源:run.go


示例2: sendAndReceiveWithQueueInternal

func sendAndReceiveWithQueueInternal(t *testing.T, redis *Transport) {

	// sender
	go func() {
		redis.RunSource(countingSource)
	}()

	// wait 2 seconds for sending to finish
	select {
	case res := <-senderChan:
		log.Debugln(res)
	case <-time.After(time.Second * 2):
		t.Fatalf("Sending did not finish in time")
	}

	//	receiver
	go func() {
		redis.RunSink(countingSink)
	}()

	// wait 2 seconds for sending to finish (it will timeout if 100 messages have not been received
	select {
	case res := <-receiverChan:
		log.Debugln(res)
	case <-time.After(time.Second * 2):
		t.Fatalf("Sending and receiving did not finish in time")
	}

}
开发者ID:frosenberg,项目名称:go-cloud-stream,代码行数:29,代码来源:redis_test.go


示例3: Resize

// Resize handles a CLI event to resize an interactive docker run or docker exec
// window.
func (clnt *client) Resize(containerID, processFriendlyName string, width, height int) error {
	// Get the libcontainerd container object
	clnt.lock(containerID)
	defer clnt.unlock(containerID)
	cont, err := clnt.getContainer(containerID)
	if err != nil {
		return err
	}

	h, w := uint16(height), uint16(width)

	if processFriendlyName == InitFriendlyName {
		logrus.Debugln("libcontainerd: resizing systemPID in", containerID, cont.process.systemPid)
		return cont.process.hcsProcess.ResizeConsole(w, h)
	}

	for _, p := range cont.processes {
		if p.friendlyName == processFriendlyName {
			logrus.Debugln("libcontainerd: resizing exec'd process", containerID, p.systemPid)
			return p.hcsProcess.ResizeConsole(w, h)
		}
	}

	return fmt.Errorf("Resize could not find containerID %s to resize", containerID)

}
开发者ID:kasisnu,项目名称:docker,代码行数:28,代码来源:client_windows.go


示例4: pullFromFiles

/* Used by Remove file, this rebuilds the splice and assigns
   the new array of Files to self */
func (self *Meta) pullFromFiles(node *Node, file *FilePointer) {

	whole_stash := false
	if file == nil {
		whole_stash = true
	}
	var new_files []Node
	for _, itr := range self.Files {
		if itr.Compare(node) && whole_stash {
			log.Debugln("skipping whole stash: ", itr.Id)
			continue
		} else if itr.Compare(node) && !whole_stash {
			var new_pointers []FilePointer
			for _, fitr := range itr.Pointers {
				if fitr.Compare(file) {
					log.Debugln("skipping file from stash")
					continue
				}
				new_pointers = append(new_pointers, fitr)
			}
			itr.Pointers = new_pointers
		}
		new_files = append(new_files, itr)
	}
	self.Files = new_files
	log.Debug("\n\n***\nFiles:\n\n", self.Files, "\n\n***\n\n")
	self.SaveStash()
}
开发者ID:kyenos,项目名称:dropstash,代码行数:30,代码来源:meta.go


示例5: handleChannel

func handleChannel(s *Stream, ch ssh.Channel, reqs <-chan *ssh.Request, handle func(*Stream)) {

	// handle requests receive for this Channel
	go func(in <-chan *ssh.Request) {
		for req := range in {
			logrus.Debugln("AdminTool -> Request of type:", req.Type, "len:", len(req.Type))
			logrus.Debugln("AdminTool -> Request payload:", string(req.Payload), "len:", len(req.Payload))

			if req.WantReply {
				req.Reply(false, nil)
			}
		}
		logrus.Debugln("AdminTool -> End of request GO chan")
	}(reqs)

	// read data from channel
	go func() {
		for {
			buffer := make([]byte, 64)
			n, err := ch.Read(buffer)
			if err != nil {
				if err.Error() == "EOF" {
					handleData(s, []byte{}, true)
					// all data received: handle Stream message
					handle(s)
					break
				} else {
					logrus.Fatalln("failed to read channel : " + err.Error())
				}
			}
			handleData(s, buffer[:n], false)
		}
	}()
}
开发者ID:gdevillele,项目名称:grpc-go,代码行数:34,代码来源:ssh_server.go


示例6: executeQuery

func executeQuery(db *bolt.DB, query string) error {
	selectStatement, err := boltq.NewParser(strings.NewReader(query)).ParseSelect()
	if err == nil {
		log.Debugf("parsed select: %v", selectStatement)
		return executeSelect(selectStatement, db)
	} else {
		log.Debugln(err.Error())
	}

	updateStatement, err := boltq.NewParser(strings.NewReader(query)).ParseUpdate()
	if err == nil {
		log.Debugf("parsed update: %v", updateStatement)
		return executeUpdate(updateStatement, db)
	} else {
		log.Debugln(err.Error())
	}

	deleteStatement, err := boltq.NewParser(strings.NewReader(query)).ParseDelete()
	if err == nil {
		log.Debugf("parsed delete: %v", deleteStatement)
		return executeDelete(deleteStatement, db)
	} else {
		log.Debugln(err.Error())
	}

	return fmt.Errorf("cannot parse: %s", query)
}
开发者ID:mnadel,项目名称:boltq,代码行数:27,代码来源:program.go


示例7: executeSelect

func executeSelect(stmt *boltq.SelectStatement, db *bolt.DB) error {
	return db.View(func(tx *bolt.Tx) error {
		var bucket *bolt.Bucket

		for _, name := range stmt.BucketPath {
			log.Debugln("navigating to bucket", name)
			bucket = tx.Bucket([]byte(name))

			if bucket == nil {
				return fmt.Errorf("cannot find bucket %s", name)
			}
		}

		if containsAsterisk(stmt.Fields) {
			log.Debugln("interating keys")
			cursor := bucket.Cursor()

			for k, v := cursor.First(); k != nil; k, v = cursor.Next() {
				emitKeypair(k, v)
			}
		} else {
			for _, k := range stmt.Fields {
				keyBytes := []byte(k)
				v := bucket.Get(keyBytes)
				emitKeypair(keyBytes, v)
			}
		}

		return nil
	})
}
开发者ID:mnadel,项目名称:boltq,代码行数:31,代码来源:program.go


示例8: load

// load calls fn inside a View with the contents of the file. Caller
// must make a copy of the data if needed.
func (f *File) load(c context.Context, fn func([]byte)) error {
	defer log.Debugln("load:", f.dir.path, f.name)
	err := f.dir.fs.backend.View(c, func(ctx Context) error {
		b, err := ctx.Dir(f.dir.path)
		if err != nil {
			return err
		}
		v, err := b.Get(f.name)
		if err != nil {
			return err
		}
		if v == nil {
			return fuse.ESTALE
		}
		switch v := v.(type) {
		case []byte:
			fn(v)
		case *File: // hard link
			if !f.same_path(v) {
				log.Debugln(f.dir.path, f.name, "->", v.dir.path, v.name)
				return v.load(c, fn)
			}
		default:
		}
		return nil
	})
	return err
}
开发者ID:conductant,项目名称:gohm,代码行数:30,代码来源:file.go


示例9: TestSendReceiveQueueSemantics2

func TestSendReceiveQueueSemantics2(t *testing.T) {

	initChannels()

	inputQueue0 := fmt.Sprintf("queue:input0-%d", time.Now().UnixNano())
	outputQueue0 := fmt.Sprintf("queue:output0-%d", time.Now().UnixNano())
	t1 := NewTransport(getKafkaBrokers(), getZookeeperHosts(), inputQueue0, outputQueue0)
	t1.Connect()
	defer t1.Disconnect()

	inputQueue1 := outputQueue0
	outputQueue1 := fmt.Sprintf("queue:output1-%d", time.Now().UnixNano())
	t2 := NewTransport(getKafkaBrokers(), getZookeeperHosts(), inputQueue1, outputQueue1)
	t2.Connect()
	defer t2.Disconnect()

	inputQueue2 := outputQueue1
	outputQueue2 := fmt.Sprintf("queue:output2-%d", time.Now().UnixNano())
	t3 := NewTransport(getKafkaBrokers(), getZookeeperHosts(), inputQueue2, outputQueue2)
	t3.Connect()
	defer t3.Disconnect()

	go func() {
		t1.RunSource(countingSource)
	}()

	// wait x seconds for sending to finish
	select {
	case res := <-senderChan:
		log.Debugln(res)
	case <-time.After(time.Second * 90):
		t.Fatalf("Sending did not finish in time")
	}

	go func() {
		t2.RunProcessor(bridgeFunc)
	}()

	// wait x seconds for bridge to finish
	select {
	case res := <-bridgeChan:
		log.Debugln(res)
	case <-time.After(time.Second * 90):
		t.Fatalf("Bridiging did not finish in time")
	}

	go func() {
		t3.RunSink(countingSink1)
	}()

	// wait x seconds for sending to finish (it will timeout if maxMessages messages have not been received)
	select {
	case res := <-receiverChan:
		log.Debugln(res)
	case <-time.After(time.Second * 90):
		t.Fatalf("Receiving did not finish in time")
	}

	closeChannels()
}
开发者ID:frosenberg,项目名称:go-cloud-stream,代码行数:60,代码来源:kafka_test.go


示例10: logEnvs

func logEnvs() error {
	environments, err := envman.ReadEnvs(envman.CurrentEnvStoreFilePath)
	if err != nil {
		return err
	}

	if len(environments) == 0 {
		log.Info("[ENVMAN] - Empty envstore")
	} else {
		for _, env := range environments {
			key, value, err := env.GetKeyValuePair()
			if err != nil {
				return err
			}

			opts, err := env.GetOptions()
			if err != nil {
				return err
			}

			envString := "- " + key + ": " + value
			log.Debugln(envString)
			if !*opts.IsExpand {
				expandString := "  " + "isExpand" + ": " + "false"
				log.Debugln(expandString)
			}
		}
	}

	return nil
}
开发者ID:bazscsa,项目名称:envman,代码行数:31,代码来源:add.go


示例11: stdouterrAccept

// stdouterrAccept runs as a go function. It waits for the container system to
// accept our offer of a named pipe - in fact two of them - one for stdout
// and one for stderr (we are called twice). Once the named pipe is accepted,
// if we are running "attached" to the container (eg docker run -i), then we
// spin up a further thread to copy anything from the containers output channels
// to the client.
func stdouterrAccept(outerrListen *npipe.PipeListener, pipeName string, copyto io.Writer) {

	// Wait for the pipe to be connected to by the shim
	logrus.Debugln("out/err: Waiting on ", pipeName)
	outerrConn, err := outerrListen.Accept()
	if err != nil {
		logrus.Errorf("Failed to accept on pipe %s %s", pipeName, err)
		return
	}
	logrus.Debugln("Connected to ", outerrConn.RemoteAddr())

	// Anything that comes from the container named pipe stdout/err should be copied
	// across to the stdout/err of the client
	if copyto != nil {
		go func() {
			defer outerrConn.Close()
			logrus.Debugln("Calling io.Copy on ", pipeName)
			bytes, err := io.Copy(copyto, outerrConn)
			logrus.Debugf("Copied %d bytes from pipe=%s", bytes, outerrConn.RemoteAddr())
			if err != nil {
				// Not fatal, just debug log it
				logrus.Debugf("Error hit during copy %s", err)
			}
		}()
	} else {
		defer outerrConn.Close()
	}
}
开发者ID:vito,项目名称:garden-linux-release,代码行数:34,代码来源:namedpipes.go


示例12: getChecks

func (sr *Runner) getChecks(maxChecks int, timeout int) []stalker.Check {
	log.Debugln("Getting checks off queue")
	checks := make([]stalker.Check, 0)
	expireTime := time.Now().Add(3 * time.Second).Unix()
	for len(checks) <= maxChecks {
		//we've exceeded our try time
		if time.Now().Unix() > expireTime {
			break
		}
		rconn := sr.rpool.Get()
		defer rconn.Close()
		res, err := redis.Values(rconn.Do("BLPOP", sr.conf.workerQueue, timeout))
		if err != nil {
			if err != redis.ErrNil {
				log.Errorln("Error grabbing check from queue:", err.Error())
				break
			} else {
				log.Debugln("redis result:", err)
				continue
			}
		}
		var rb []byte
		res, err = redis.Scan(res, nil, &rb)
		var check stalker.Check
		if err := json.Unmarshal(rb, &check); err != nil {
			log.Errorln("Error decoding check from queue to json:", err.Error())
			break
		}
		checks = append(checks, check)
	}
	return checks
}
开发者ID:pandemicsyn,项目名称:stalker,代码行数:32,代码来源:runner.go


示例13: add

func add(c *cli.Context) {
	log.Debugln("[ENVMAN] - Work path:", envman.CurrentEnvStoreFilePath)

	key := c.String(KeyKey)
	expand := !c.Bool(NoExpandKey)
	replace := !c.Bool(AppendKey)

	var value string
	if stdinValue != "" {
		value = stdinValue
	} else if c.IsSet(ValueKey) {
		value = c.String(ValueKey)
	} else if c.String(ValueFileKey) != "" {
		if v, err := loadValueFromFile(c.String(ValueFileKey)); err != nil {
			log.Fatal("[ENVMAN] - Failed to read file value: ", err)
		} else {
			value = v
		}
	}

	if err := addEnv(key, value, expand, replace); err != nil {
		log.Fatal("[ENVMAN] - Failed to add env:", err)
	}

	log.Debugln("[ENVMAN] - Env added")

	if err := logEnvs(); err != nil {
		log.Fatal("[ENVMAN] - Failed to print:", err)
	}
}
开发者ID:bazscsa,项目名称:envman,代码行数:30,代码来源:add.go


示例14: persist

func persist(db *bolt.DB, args []string) error {
	tx, err := db.Begin(true)
	if err != nil {
		return err
	}
	log.Debugln("start transaction.")
	for _, v := range args {
		log.Debugln(v)
		bucket := tx.Bucket([]byte(BUCKET_NAME))
		if bucket == nil {
			bucket, err = tx.CreateBucket([]byte(BUCKET_NAME))
			if err != nil {
				return err
			}
			count := btoi(bucket.Get([]byte(v)))
			count += 1
			err = bucket.Put([]byte(v), itob(count))
			if err != nil {
				tx.Rollback()
				return err
			}
		}
	}

	tx.Commit()
	return nil
}
开发者ID:saiki,项目名称:collection,代码行数:27,代码来源:add.go


示例15: main

func main() {
	log.SetLevel(log.DebugLevel)
	log.Infoln("*******************************************")
	log.Infoln("Port Scanner")
	log.Infoln("*******************************************")

	t := time.Now()
	defer func() {
		if e := recover(); e != nil {
			log.Debugln(e)
		}
	}()

	log.Debugln(loadConfig("config.properties"))

	log.Debugln("Parsed input data ", len(portScannerTuple.portScannerResult))
	CheckPort(&portScannerTuple)

	for key, value := range portScannerTuple.portScannerResult {
		if value {
			log.Debugln("Port Scanner Result", key, " port is open :", value)
		}
	}

	log.Debugln("Total time taken %s to scan %d ports", time.Since(t), len(portScannerTuple.portScannerResult))
}
开发者ID:beeyeas,项目名称:portscanner,代码行数:26,代码来源:portscanner.go


示例16: main

func main() {

	var (
		configDir   string
		hideConsole bool
		showConsole bool
		debugLog    bool
	)

	flag.StringVar(&configDir, "configdir", "", "Configuration directory")
	flag.BoolVar(&hideConsole, "hidecon", false, "Hide console")
	flag.BoolVar(&showConsole, "showcon", false, "Show console")
	flag.BoolVar(&debugLog, "debuglog", false, "Show console")
	flag.Parse()
	//log.Debugln("Command line: " + flag.CommandLine)

	log.SetOutput(os.Stderr)
	log.SetLevel(log.DebugLevel)

	log.Debugln("os.Args: ", os.Args)
	log.Debugln("ConfigDir: ", configDir)
	if configDir != "" {
		Locations[LocationConfigFile] = configDir
	}
	InitLocations()
	throughBox.LoadConfig(Locations[LocationConfigFile], true)

	//	for _, item := range PortMapList {
	//		fmt.Printf("%#v %#v %#v \n", item.Port, *(item.SourceIP), item.DestinationAdress)
	//	}

	log.Debugln("Start")
	throughBox.Start()
	throughBox.Wait()
}
开发者ID:yazver,项目名称:throughbox,代码行数:35,代码来源:throughbox.go


示例17: newSSH2Client

// newSSH2Client constructs a connected ClientTransport to addr based on HTTP2
// and starts to receive messages on it. Non-nil error returns if construction
// fails.
func newSSH2Client(addr string, opts *ConnectOptions) (_ ClientTransport, err error) {

	logrus.SetLevel(logrus.DebugLevel)

	logrus.Debugln("newSSH2Client")
	logrus.Debugln("newSSH2Client -- addr:", addr)
	logrus.Debugln("newSSH2Client -- opts:", opts)

	// generate hostKey, needed to ssh connect
	appPath, err := osext.Executable()
	if err != nil {
		return nil, err
	}
	keyPath := filepath.Join(filepath.Dir(appPath), "key.pem")
	hostKey, err := sshutil.KeyLoader{Path: keyPath, Flags: sshutil.Create + sshutil.Save + sshutil.RSA2048}.Load()
	if err != nil {
		return nil, err
	}

	config := &ssh.ClientConfig{
		User: "test",
		Auth: []ssh.AuthMethod{
			ssh.Password("test"),
			ssh.PublicKeys(hostKey),
		},
	}

	// client is an ssh.Client with is of type ssh.Conn
	client, err := ssh.Dial("tcp", addr, config)

	if err != nil {
		return nil, ConnectionErrorf("transport: %v", err)
	}

	// Ad: original code sends http2.ClientPreface here (conn.Write)
	// I don't think it's needed in our case. We have SSH auth, subsystems...

	// Ad: then creates a new "framer"
	// We will implement this differently. From what I understood, each frame comes with a header
	// And it allows get the corresponding stream...etc
	// In our case, each request will have its dedicated ssh Channel (Stream), so we don't have
	// to do any logic to find the context.

	t := &ssh2Client{
		conn:               client,
		writableChan:       make(chan int, 1),
		shutdownChan:       make(chan struct{}),
		errorChan:          make(chan struct{}),
		controlBuf:         newRecvBuffer(),
		sendQuotaPool:      newQuotaPool(defaultWindowSize),
		state:              reachable,
		streamSendQuota:    defaultWindowSize,
		channelsByStreamId: make(map[uint32]*ssh.Channel),
	}

	t.writableChan <- 0
	return t, nil
}
开发者ID:gdevillele,项目名称:grpc-go,代码行数:61,代码来源:ssh_client.go


示例18: append

/* De-duplicate staging / stash note this should be private to
   Meta */
func (self *Meta) append(stgNode Node, stgFile *os.File) {

	pointer := stgNode.Pointers[0] //there can only be one here!
	log.Debugln("A dump of our file so far:\n***\n %v\n\n***", stgNode)
	defer self.RebuildLookup() //we can do this nomatter what the outcome
	defer self.SaveStash()
	for itr := range self.Files { //loop over everything in the stash if we have to
		node := &self.Files[itr]
		log.Debugln("Comparing to:", node.Id)
		if node.ChkSum == stgNode.ChkSum { //we have a flat out duplicate
			log.Info("Found a duplicate of ", node.Id)
			pointer.Version = len(node.Pointers)
			node.Pointers = append(node.Pointers, pointer)
			node.PickupCount += 1
			stgFile.Close()
			os.Remove(config.Staging_loc + "/" + stgNode.Id)
			return
		}
		stashfl, err := os.Open(config.Stash_loc + "/" + node.Id)
		if err != nil {
			log.Errorln("Failed to open stash file: ", node.Id)
			break //TODO; is it possible that this could introduce a zombi?
		}
		leftCheck, _ := self.calcMd5sum(stashfl, stgNode.Size)
		stashfl.Close()
		log.Debugln("LeftCheck for stgNode.size; ", stgNode.Size, " is: ", leftCheck)
		if leftCheck == stgNode.ChkSum { //incoming file is a partial of this file
			log.Info("Incoming file is a partial of: ", node.Id)
			pointer.Version = len(node.Pointers)
			node.Pointers = append(node.Pointers, pointer)
			node.PartialCount += 1
			stgFile.Close() //we only add the pointer and remove the staged file
			os.Remove(config.Staging_loc + "/" + stgNode.Id)
			return
		}
		stgFile.Seek(0, 0)
		rightCheck, _ := self.calcMd5sum(stgFile, node.Size)
		log.Debugln("RightCheck for stgNode.size; ", stgNode.Size, " is: ", rightCheck)
		if rightCheck == node.ChkSum { //stashed file is a partial of the incoming file
			log.Info("Stashed file ", node.Id, " is a partial of incoming file")
			pointer.Version = len(node.Pointers)
			node.Pointers = append(node.Pointers, pointer)
			node.PickupCount += 1
			node.PartialCount += 1
			stgFile.Close() //we keep the incoming file and ditch the staged file, keep the old id
			os.Rename(config.Staging_loc+"/"+stgNode.Id, config.Stash_loc+"/"+node.Id)
			node.Size = stgNode.Size
			node.ChkSum = stgNode.ChkSum
			return
		}
	} //stage file is unique to the stash, add and move
	log.Info("New file is unique, adding to stash as", stgNode.Id)
	stgFile.Close()
	self.Files = append(self.Files, stgNode) // this happens if we are not a duplicate or partial
	self.Count = len(self.Files)
	os.Rename(config.Staging_loc+"/"+stgNode.Id, config.Stash_loc+"/"+stgNode.Id)
	return
}
开发者ID:kyenos,项目名称:dropstash,代码行数:60,代码来源:meta.go


示例19: countingSink

func countingSink(input <-chan *api.Message) {
	log.Debugln("countingSink started")

	for i := 0; i < maxMessages; i++ {
		msg := <-input
		log.Debugln("Received message: ", msg)
	}
	receiverChan <- "countingSink"
}
开发者ID:frosenberg,项目名称:go-cloud-stream,代码行数:9,代码来源:redis_test.go


示例20: goBuildInIsolation

func goBuildInIsolation(packageName, srcPath, outputBinPath string) error {
	log.Debugf("=> Installing package (%s) to path (%s) ...", packageName, srcPath)
	workspaceRootPath, err := pathutil.NormalizedOSTempDirPath("bitrise-go-toolkit")
	if err != nil {
		return fmt.Errorf("Failed to create root directory of isolated workspace, error: %s", err)
	}
	log.Debugln("=> Using sandboxed workspace:", workspaceRootPath)

	// origGOPATH := os.Getenv("GOPATH")
	// if origGOPATH == "" {
	// 	return fmt.Errorf("You don't have a GOPATH environment - please set it; GOPATH/bin will be symlinked")
	// }

	// log.Debugln("=> Symlink GOPATH/bin into sandbox ...")
	// if err := gows.CreateGopathBinSymlink(origGOPATH, workspaceRootPath); err != nil {
	// 	return fmt.Errorf("Failed to create GOPATH/bin symlink, error: %s", err)
	// }
	// log.Debugln("   [DONE]")

	fullPackageWorkspacePath := filepath.Join(workspaceRootPath, "src", packageName)
	log.Debugf("=> Creating Symlink: (%s) -> (%s)", srcPath, fullPackageWorkspacePath)
	if err := gows.CreateOrUpdateSymlink(srcPath, fullPackageWorkspacePath); err != nil {
		return fmt.Errorf("Failed to create Project->Workspace symlink, error: %s", err)
	}
	log.Debugf(" [DONE] Symlink is in place")

	log.Debugln("=> Building package " + packageName + " ...")
	{
		isInstallRequired, _, goConfig, err := selectGoConfiguration()
		if err != nil {
			return fmt.Errorf("Failed to select an appropriate Go installation for compiling the step, error: %s", err)
		}
		if isInstallRequired {
			return fmt.Errorf("Failed to select an appropriate Go installation for compiling the step, error: %s",
				"Found Go version is older than required. Please run 'bitrise setup' to check and install the required version")
		}

		cmd := gows.CreateCommand(workspaceRootPath, workspaceRootPath,
			goConfig.GoBinaryPath, "build", "-o", outputBinPath, packageName)
		cmd.Env = append(cmd.Env, "GOROOT="+goConfig.GOROOT)
		if err := cmd.Run(); err != nil {
			return fmt.Errorf("Failed to install package, error: %s", err)
		}
	}
	log.Debugln("   [DONE] Package successfully installed")

	log.Debugln("=> Delete isolated workspace ...")
	{
		if err := os.RemoveAll(workspaceRootPath); err != nil {
			return fmt.Errorf("Failed to delete temporary isolated workspace, error: %s", err)
		}
	}
	log.Debugln("   [DONE]")

	return nil
}
开发者ID:bitrise-io,项目名称:bitrise,代码行数:56,代码来源:golang.go



注:本文中的github.com/Sirupsen/logrus.Debugln函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang logrus.Error函数代码示例发布时间:2022-05-28
下一篇:
Golang logrus.Debugf函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap