Re: [go-nuts] getting method comments from a package

2016-09-26 Thread Dan Kortschak
With some playing, I get to this, which gives me what I want for downstream. func DocComments(path string) (docs map[string]map[string][]*ast.Comment, err error) { fset := token.NewFileSet() pkgs, err := parser.ParseDir(fset, path, nil, parser.ParseComments) if err != nil

Re: [go-nuts] getting method comments from a package

2016-09-26 Thread Dan Kortschak
Yeah, possibly. Is there is way though to get the associated ast.CommentGroup for a type's methods? On Mon, 2016-09-26 at 20:59 -0700, Rob Pike wrote: > It might be less disgusting to use text/scanner. > > -rob -- You received this message because you are subscribed to the Google Groups "gola

Re: [go-nuts] getting method comments from a package

2016-09-26 Thread Rob Pike
It might be less disgusting to use text/scanner. -rob On Mon, Sep 26, 2016 at 5:46 PM, Dan Kortschak < dan.kortsc...@adelaide.edu.au> wrote: > Is there a nicer way to do this than what I have here? > > func MethodDocComments(path string) (map[string]string, error) { > fset := token.NewF

[go-nuts] getting method comments from a package

2016-09-26 Thread Dan Kortschak
Is there a nicer way to do this than what I have here? func MethodDocComments(path string) (map[string]string, error) { fset := token.NewFileSet() pkgs, err := parser.ParseDir(fset, path, nil, parser.ParseComments) if err != nil { return nil, err }

[go-nuts] Semingly random issues using filepath.Walk

2016-09-26 Thread cloudyhls
I am trying to loop through a very large directory and build a list of files from Palantir using a simple go filepath.Walk(). Thats it really. Nothing complex... but it seems we have a memory leak or something? Any ideas why this might be happening? fatal error: unexpected signal during runtime

[go-nuts] Naming initialisms or acronyms containing lowercase letters

2016-09-26 Thread sbkim via golang-nuts
go/gocomments#TOC-Initialisms says initialisms or acronyms (e.g. "URL" or "NATO") have a consistent case: URL or url. But sometimes we have ToR (top-of-rack switch), QoS (quality of service), or DoS (denial of service) that are commonly written with a combination of upper- and lower-case letter

Re: [go-nuts] Golang smtp package support for CC and BCC

2016-09-26 Thread Bakul Shah
On Mon, 26 Sep 2016 00:06:11 PDT Asit Dhal wrote: > > I don't see any functions in Golang net/smtp package for CC and BCC. > Does it support those functionalities ? > If not, is there any work around for that ? All of to, cc & bcc addresses from an email's headers must be sent using RCPT comman

[go-nuts] Re: io.MultiWriter has an extra check to bytes written

2016-09-26 Thread thebrokentoaster
That code was written in 2010, while the specification for io.Writer was written in 2009. Go 1.0 was released in 2012. Prior to Go 1.0, there wasn't any strict compatibility agreement, so many things were in flux throughout the code base. So, I assume that Brad added that check back then to hand

[go-nuts] Golang Generating Contact API XML for new user

2016-09-26 Thread alex
I am trying to create a new contact using the google contact api, however its atom feed and XML. There doesn't seem to be a Golang library to do this. I have got to here: var c models.Category c.Scheme = "http://schemas.google.com/g/2005#kind"; c.Term = "http://schemas.google.com/contact/200

Re: [go-nuts] Golang smtp package support for CC and BCC

2016-09-26 Thread Konstantin Khomoutov
On Mon, 26 Sep 2016 14:49:57 + "Manuel Amador (Rudd-O)" wrote: > > I don't see any functions in Golang net/smtp package for CC and > > BCC. Does it support those functionalities ? > > If not, is there any work around for that ? > > My RFC2822 knowledge is very rusty, but isn't that just a fu

Re: [go-nuts] Golang smtp package support for CC and BCC

2016-09-26 Thread Manuel Amador (Rudd-O)
On 09/26/2016 07:06 AM, Asit Dhal wrote: > Hi, > I don't see any functions in Golang net/smtp package for CC and BCC. > Does it support those functionalities ? > If not, is there any work around for that ? My RFC2822 knowledge is very rusty, but isn't that just a function of the MIME headers you

[go-nuts] [ANN] curvetls:

2016-09-26 Thread Manuel Amador (Rudd-O)
Hello, Gophers! I am announcing the first iteration of curvetls: a Go library that provides a robust framing and encryption layer for your Go programs, striving to be secure, strict, and simple. With curvetls, it's dead easy to go from raw sockets to secure channels, based on CurveCP (NaCL) encry

[go-nuts] Golang smtp package support for CC and BCC

2016-09-26 Thread Asit Dhal
Hi, I don't see any functions in Golang net/smtp package for CC and BCC. Does it support those functionalities ? If not, is there any work around for that ? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] type-embeded consts and variables request

2016-09-26 Thread 'Axel Wagner' via golang-nuts
I think you are overcomplicating things for yourself. Just use the solution Jan has provided. If you don't want people to need to import time additionally, re-export the constants from your own package. No need to define a new type. On Mon, Sep 26, 2016 at 11:17 AM, Ally Dale wrote: > In final w

Re: [go-nuts] type-embeded consts and variables request

2016-09-26 Thread Ally Dale
In final words, the KEY problem of my topic is: It's easy to extending exists public types by redefine or use struct's no-name embeding in Golang. The new types will inherit all data and public methods from the old package. But there is NO WAYS to inherit public consts and variables defined from

Re: [go-nuts] type-embeded consts and variables request

2016-09-26 Thread Ally Dale
I think that is not a good idea. First of all, I can't define these consts everywhere,so I have to create a new package(eg:mytime) to define them. And then, client package may use like this: import( "time" ".../mytime" ) dur2WeeksAnd7Hours := mytime.Week*2+time.Hour*7 I think this code may make th

Re: [go-nuts] Re: fmt Package

2016-09-26 Thread andrey mirtchovski
your questions don't make much sense without additional context. in particular > this(fmt.Sprintf) looks like a vague misunderstanding of how to avoid infinite recursion in one's own Stringer interface implementation (https://golang.org/pkg/fmt/#pkg-overview): type X string func (x X) St

[go-nuts] Re: fmt Package

2016-09-26 Thread hadiesmaili85
i am new in go language. just i have questions > thank u for answers >> > On Sunday, September 25, 2016 at 10:12:58 AM UTC-7, hadies...@gmail.com wrote: > > what is difference between in *fmt.Printf* function and *fmt.Sprintf* ??? > > -- You received this message because you are subscribed to t

[go-nuts] Re: Record audio on Windows

2016-09-26 Thread Dominik Link
I solved it by using ffmpeg: inputDeviceName := "Microphone (Realtek High Definition Audio)" outputFile := "recording.mp3" cmd := exec.Command("C:/Dev/ffmpeg/bin/ffmpeg.exe", "-f","dshow", "-i","audio=" + inputDeviceName, outputFile) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr cmd.Stdin = os.