FAQ
Reviewers: golang-dev1,

Message:
Hello golang-dev@googlegroups.com,

I'd like you to review this change to
https://dvyukov%40google.com@code.google.com/p/go/


Description:
runtime/race: improve public documentation
Move the documentatino from race.go to doc.go, because
race.go uses +build race, so it's not normally parsed by go doc.
Rephrase the documentation for end users, provide link to race
detector manual.
Fixes issue 5444.

Please review this at https://codereview.appspot.com/9144050/

Affected files:
    A src/pkg/runtime/race/doc.go
    M src/pkg/runtime/race/race.go


Index: src/pkg/runtime/race/doc.go
===================================================================
new file mode 100644
--- /dev/null
+++ b/src/pkg/runtime/race/doc.go
@@ -0,0 +1,9 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package race implements data race detection logic.
+// No public interface is provided.
+// For details about the race detector see
+// http://golang.org/doc/articles/race_detector.html
+package race
Index: src/pkg/runtime/race/race.go
===================================================================
--- a/src/pkg/runtime/race/race.go
+++ b/src/pkg/runtime/race/race.go
@@ -4,7 +4,6 @@

   // +build race,linux,amd64 race,darwin,amd64 race,windows,amd64

-// Package race provides low-level facilities for data race detection.
   package race

   /*


--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Minux Ma at May 12, 2013 at 4:15 pm
    description: s/documentatino/documentation/.

    should we also fix cmd/godoc?

    https://codereview.appspot.com/9144050/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Minux at May 12, 2013 at 4:16 pm
    the change itself LGTM.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Andrew Gerrand at May 13, 2013 at 12:32 am
    LGTM

    I'll also apply this to the release branch.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rob Pike at May 13, 2013 at 1:28 am
    LGTM

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dvyukov at May 13, 2013 at 6:24 am

    On 2013/05/12 16:15:18, minux wrote:
    description: s/documentatino/documentation/. done
    should we also fix cmd/godoc?
    what exactly do you mean?
    I think it's bad idea to parse all files. There can be "+build"
    (disabled) files and lots of duplicates and irrelevant functions for
    e.g. syscall.


    https://codereview.appspot.com/9144050/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Minux at May 13, 2013 at 7:56 am

    On Mon, May 13, 2013 at 2:24 PM, wrote:

    should we also fix cmd/godoc?
    what exactly do you mean?
    I think it's bad idea to parse all files. There can be "+build"
    (disabled) files and lots of duplicates and irrelevant functions for
    e.g. syscall.
    sorry, i should have been more specific here.

    do you think it's a bug of godoc to regard runtime/race as a command prior
    to this CL?
    (there is no package main in runtime/race)

    $ godoc runtime 2>/dev/null |head -1
    PACKAGE DOCUMENTATION
    $ godoc runtime/race 2>/dev/null |head -1
    COMMAND DOCUMENTATION

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dmitry Vyukov at May 13, 2013 at 8:18 am

    On Mon, May 13, 2013 at 11:56 AM, minux wrote:
    On Mon, May 13, 2013 at 2:24 PM, wrote:

    should we also fix cmd/godoc?
    what exactly do you mean?
    I think it's bad idea to parse all files. There can be "+build"
    (disabled) files and lots of duplicates and irrelevant functions for
    e.g. syscall.
    sorry, i should have been more specific here.

    do you think it's a bug of godoc to regard runtime/race as a command prior
    to this CL?
    (there is no package main in runtime/race)

    $ godoc runtime 2>/dev/null |head -1
    PACKAGE DOCUMENTATION
    $ godoc runtime/race 2>/dev/null |head -1
    COMMAND DOCUMENTATION
    Probably it's a bug, I don't know.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Minux at May 13, 2013 at 8:56 am

    On Mon, May 13, 2013 at 4:18 PM, Dmitry Vyukov wrote:
    On Mon, May 13, 2013 at 11:56 AM, minux wrote:
    On Mon, May 13, 2013 at 2:24 PM, wrote:

    should we also fix cmd/godoc?
    what exactly do you mean?
    I think it's bad idea to parse all files. There can be "+build"
    (disabled) files and lots of duplicates and irrelevant functions for
    e.g. syscall.
    sorry, i should have been more specific here.

    do you think it's a bug of godoc to regard runtime/race as a command prior
    to this CL?
    (there is no package main in runtime/race)

    $ godoc runtime 2>/dev/null |head -1
    PACKAGE DOCUMENTATION
    $ godoc runtime/race 2>/dev/null |head -1
    COMMAND DOCUMENTATION
    Probably it's a bug, I don't know.
    Ah, it's a special case for the tools written in C,
    from cmd/godoc/godoc.go:
             // collect package files
             pkgname := pkginfo.Name
             pkgfiles := append(pkginfo.GoFiles, pkginfo.CgoFiles...)
             if len(pkgfiles) == 0 {
                     // Commands written in C have no .go files in the build.
                     // Instead, documentation may be found in an ignored file.
                     // The file may be ignored via an explicit +build ignore
                     // constraint (recommended), or by defining the package
                     // documentation (historic).
                     pkgname = "main" // assume package main since pkginfo.Name
    == ""
                     pkgfiles = pkginfo.IgnoredGoFiles
             }

    so any package without Go source is treated as a command.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dvyukov at May 13, 2013 at 6:28 am
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=d29da2ced72b ***

    runtime/race: improve public documentation
    Move the documentation from race.go to doc.go, because
    race.go uses +build race, so it's not normally parsed by go doc.
    Rephrase the documentation for end users, provide link to race
    detector manual.
    Fixes issue 5444.

    R=golang-dev, minux.ma, adg, r
    CC=golang-dev
    https://codereview.appspot.com/9144050


    https://codereview.appspot.com/9144050/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedMay 12, '13 at 11:11a
activeMay 13, '13 at 8:56a
posts10
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase