github.com/sams1990/dockerrepo@v17.12.1-ce-rc2+incompatible/daemon/logger/logger_test.go (about)

     1  package logger
     2  
     3  import (
     4  	"github.com/docker/docker/api/types/backend"
     5  )
     6  
     7  func (m *Message) copy() *Message {
     8  	msg := &Message{
     9  		Source:    m.Source,
    10  		Partial:   m.Partial,
    11  		Timestamp: m.Timestamp,
    12  	}
    13  
    14  	if m.Attrs != nil {
    15  		msg.Attrs = make([]backend.LogAttr, len(m.Attrs))
    16  		copy(msg.Attrs, m.Attrs)
    17  	}
    18  
    19  	msg.Line = append(make([]byte, 0, len(m.Line)), m.Line...)
    20  	return msg
    21  }