1. 06 May, 2013 3 commits
    • Jeremiah Harmsen's avatar
      go/doc/example: Fix bug causing false negatives for Example playability. · a228e733
      Jeremiah Harmsen authored
      Allows Examples with KeyValue expressions to be playable in godoc.
      
      During the traversal of the abstract syntax tree any KeyValueExpr Key.Name was incorrectly being added as an unresolved identifier.
      Since this identifier could not be provided the Example was marked as unplayable.
      This updates the AST traversal to skip Keys (but continue traversing the Values).
      
      Example of problematic AST now fixed (see L99 where "UpperBound" was being added as a missing identifier):
      
       81  .  .  .  .  .  .  .  .  .  Values: []ast.Expr (len = 1) {
       82  .  .  .  .  .  .  .  .  .  .  0: *ast.UnaryExpr {
       83  .  .  .  .  .  .  .  .  .  .  .  OpPos: 12:19
       84  .  .  .  .  .  .  .  .  .  .  .  Op: &
       85  .  .  .  .  .  .  .  .  .  .  .  X: *ast.CompositeLit {
       86  .  .  .  .  .  .  .  .  .  .  .  .  Type: *ast.SelectorExpr {
       87  .  .  .  .  .  .  .  .  .  .  .  .  .  X: *ast.Ident {
       88  .  .  .  .  .  .  .  .  .  .  .  .  .  .  NamePos: 12:20
       89  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Name: "t_proto"
       90  .  .  .  .  .  .  .  .  .  .  .  .  .  }
       91  .  .  .  .  .  .  .  .  .  .  .  .  .  Sel: *ast.Ident {
       92  .  .  .  .  .  .  .  .  .  .  .  .  .  .  NamePos: 12:41
       93  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Name: "BConfig"
       94  .  .  .  .  .  .  .  .  .  .  .  .  .  }
       95  .  .  .  .  .  .  .  .  .  .  .  .  }
       96  .  .  .  .  .  .  .  .  .  .  .  .  Lbrace: 12:79
       97  .  .  .  .  .  .  .  .  .  .  .  .  Elts: []ast.Expr (len = 2) {
       98  .  .  .  .  .  .  .  .  .  .  .  .  .  0: *ast.KeyValueExpr {
       99  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Key: *ast.Ident {
      100  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  NamePos: 13:3
      101  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Name: "UpperBound"
      102  .  .  .  .  .  .  .  .  .  .  .  .  .  .  }
      103  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Colon: 13:13
      104  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Value: *ast.CallExpr {
      105  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Fun: *ast.SelectorExpr {
      106  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  X: *ast.Ident {
      107  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  NamePos: 13:15
      108  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Name: "proto"
      109  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  }
      110  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Sel: *ast.Ident {
      111  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  NamePos: 13:21
      112  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  Name: "Float32"
      113  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  }
      
      R=adg
      CC=gobot, golang-dev, gri
      https://golang.org/cl/8569045
      a228e733
    • Andrew Gerrand's avatar
      C: add Jeremiah Harmsen (Google CLA) · b13eac88
      Andrew Gerrand authored
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/9229043
      b13eac88
    • Brad Fitzpatrick's avatar
      image/png: fix error message to not return width twice · 1294f14f
      Brad Fitzpatrick authored
      Fixes #5413
      
      R=golang-dev, dave, adg
      CC=golang-dev
      https://golang.org/cl/9153045
      1294f14f
  2. 04 May, 2013 1 commit
  3. 03 May, 2013 5 commits
  4. 02 May, 2013 3 commits
  5. 01 May, 2013 6 commits
  6. 30 Apr, 2013 13 commits
  7. 29 Apr, 2013 4 commits
  8. 28 Apr, 2013 1 commit
  9. 27 Apr, 2013 1 commit
    • Dave Cheney's avatar
      runtime: tune appendCrossover for arm · d09f34cc
      Dave Cheney authored
      Turns out the optimal value is 8 on cortex-A9 systems (pandaboard)
      
      benchmark                     old ns/op    new ns/op    delta
      BenchmarkAppend                     907          908   +0.11%
      BenchmarkAppend1Byte                101          101   +0.00%
      BenchmarkAppend4Bytes               116          116   +0.00%
      BenchmarkAppend8Bytes               139          138   -0.72%
      BenchmarkAppend16Bytes              185          158  -14.59%
      BenchmarkAppend32Bytes              131          131   +0.00%
      BenchmarkAppendStr1Byte              72           72   +0.00%
      BenchmarkAppendStr4Bytes             93           93   -0.21%
      BenchmarkAppendStr8Bytes            116          116   +0.00%
      BenchmarkAppendStr16Bytes           161          125  -22.36%
      BenchmarkAppendStr32Bytes           102          102   +0.00%
      BenchmarkAppendSpecialCase          613          613   +0.00%
      
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/8863045
      d09f34cc
  10. 26 Apr, 2013 2 commits
  11. 25 Apr, 2013 1 commit
    • Brad Fitzpatrick's avatar
      database/sql: fix driver Conn refcounting with prepared statements · 277047f5
      Brad Fitzpatrick authored
      The refcounting of driver Conns was completedly busted and
      would leak (be held open forever) with any reasonable
      load. This was a significant regression from Go 1.0.
      
      The core of this patch is removing one line:
      
           s.db.addDep(dc, s)
      
      A database conn (dc) is a resource that be re-created any time
      (but cached for speed) should not be held open forever with a
      dependency refcount just because the Stmt (s) is alive (which
      typically last for long periods of time, like forever).
      
      The meat of the patch is new tests. In fixing the real issue,
      a lot of tests then failed due to the fakedb_test.go's paranoia
      about closing a fakeConn while it has open fakeStmts on it. I
      could've ignored that, but that's been a problem in the past for
      other bugs.
      
      Instead, I now track per-Conn open statements and close them
      when the the conn closes.  The proper way to do this would've
      been making *driverStmt a finalCloser and using the dep mechanism,
      but it was much more invasive. Added a TODO instead.
      
      I'd like to give a way for drivers to opt-out of caring about
      driver.Stmt closes before a driver.Conn close, but that's a TODO
      for the future, and that TODO is added in this CL.
      
      I know this is very late for Go 1.1, but database/sql is
      currently nearly useless without this.
      
      I'd like to believe all these database/sql bugs in the past
      release cycle are the result of increased usage, number of
      drivers, and good feedback from increasingly-capable Go
      developers, and not the result of me sucking.  It's also hard
      with all the real drivers being out-of-tree, so I'm having to
      add more and more hooks to fakedb_test.go to simulate things
      which real drivers end up doing.
      
      Fixes #5323
      
      R=golang-dev, snaury, gwenn.kahz, google, r
      CC=golang-dev
      https://golang.org/cl/8836045
      277047f5