Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: third_party/golang/src/fmt/print.go

Issue 1426513005: Modify local copy of fmt package to deep print structures with pointers. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix comment. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/golang/README ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/golang/src/fmt/print.go
diff --git a/third_party/golang/src/fmt/print.go b/third_party/golang/src/fmt/print.go
index a84375b25e9161588d259a5da1b4805dc11971ed..8cd238e772e545b5fe5f1ee72d5d30db4afc8f8a 100644
--- a/third_party/golang/src/fmt/print.go
+++ b/third_party/golang/src/fmt/print.go
@@ -998,7 +998,10 @@ BigSwitch:
v := f.Pointer()
// pointer to array or slice or struct? ok at top level
// but not embedded (avoid loops)
- if v != 0 && depth == 100 {
+ // Note(rudominer) Local change. Deep print structures
+ // that contain pointers. Original code reads:
+ // if v != 0 && depth == 0 {
+ if v != 0 && depth < 50 {
switch a := f.Elem(); a.Kind() {
case reflect.Array, reflect.Slice:
p.buf.WriteByte('&')
@@ -1012,6 +1015,11 @@ BigSwitch:
p.buf.WriteByte('&')
p.printValue(a, verb, depth+1)
break BigSwitch
+ // Note(rudominer) Local change. Deep print pointers to strings.
+ case reflect.String:
+ p.buf.WriteByte('&')
+ p.printValue(a, verb, depth+1)
+ break BigSwitch
}
}
fallthrough
« no previous file with comments | « third_party/golang/README ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698