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
327 B
Go

8 years ago
package main
import (
"fmt"
)
type entity struct {
t uint32
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: %d size: %d data: %x}", e.t, e.size, e.body)
}
8 years ago
return fmt.Sprintf("{entity type: %d size: %d data: %x...}", e.t, e.size, e.body[:27])
8 years ago
}