You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
331 B
Go

8 years ago
package main
import (
"fmt"
)
type entity struct {
8 years ago
t entityType
8 years ago
size uint32
body []byte
}
func (e entity) String() string {
8 years ago
if len(e.body) < 30 {
8 years ago
return fmt.Sprintf("{entity type: %s size: %d data: %x}", e.t, e.size, e.body)
8 years ago
}
8 years ago
return fmt.Sprintf("{entity type: %s size: %d data: %x...}", e.t, e.size, e.body[:27])
8 years ago
}