From 4a566395874113e38b5785fc5e436c96c001b032 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 22 Nov 2017 23:02:41 -0500 Subject: textprot.Mode: also implement GoStringer to have octal when debugging --- textproto/types.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/textproto/types.go b/textproto/types.go index dd4c48d..a4b438a 100644 --- a/textproto/types.go +++ b/textproto/types.go @@ -84,6 +84,10 @@ func (m Mode) String() string { return fmt.Sprintf("%06o", m) } +func (m Mode) GoString() string { + return fmt.Sprintf("%07o", m) +} + func PathEscape(path Path) string { if strings.HasPrefix(string(path), "\"") || strings.ContainsRune(string(path), '\n') { return "\"" + strings.Replace(strings.Replace(strings.Replace(string(path), "\\", "\\\\", -1), "\"", "\\\"", -1), "\n", "\\n", -1) + "\"" -- cgit v1.2.3