Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1551)

Issue 12405043: code review 12405043: testing: add Frames method to adjust the logging of the... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
5 years, 10 months ago by dfc
Modified:
5 years, 10 months ago
Reviewers:
r, golang-dev
Visibility:
Public.

Description

testing: add Frames method to adjust the logging of the caller Fixes issue 4899. Work in progress * {T,B}.Frames(n) returns an unexported type, this is considered antisocial. * In patchset 4, the api tool rejects the change even though B, T never directly exported these methods. Patchset 5 reorganises things to make the api tool happy.

Patch Set 1 #

Patch Set 2 : diff -r bf1cd157b3e0 https://code.google.com/p/go #

Patch Set 3 : diff -r bf1cd157b3e0 https://code.google.com/p/go #

Patch Set 4 : diff -r bf1cd157b3e0 https://code.google.com/p/go #

Patch Set 5 : diff -r bf1cd157b3e0 https://code.google.com/p/go #

Patch Set 6 : diff -r bf1cd157b3e0 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -30 lines) Patch
M src/pkg/testing/benchmark.go View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
M src/pkg/testing/testing.go View 1 2 3 4 6 chunks +50 lines, -30 lines 0 comments Download

Messages

Total messages: 3
dfc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
5 years, 10 months ago (2013-08-03 10:40:29 UTC) #1
r
I'm not a fan of this. It's clumsy, unnecessary, and exposes an implementation-specific detail of ...
5 years, 10 months ago (2013-08-03 13:23:42 UTC) #2
r
5 years, 10 months ago (2013-08-03 13:35:15 UTC) #3
It wouldn't satisfy all my objections, but a nicer design would be
something like

// Up returns a *T object whose error reports identify the line n callers
up the frame.
func (t *T) Up(n) *t { .... }

Then you could write

   t.Up(1).Error("this would be tagged with the caller's line number")

I believe that can be done behind the scenes without corrupting the API. I
remain unconvinced, though, since it encourages the creation of testing
helpers, which are the devil's handiwork.

-rob
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b