Dorival Pedroso | 28 Jan 15:03 2015
Picon

disable gofmt locally

hi, i'm wondering if it would be possible to disable gofmt in parts of the code?

for instance, when writing a matrix, this looks nicer
{{  m,        0.,       0.,   -m,        0.,       0. },
 { 0.,   12.  *n,  6.*l *n,   0.,  -12.  *n,  6.*l *n },
 { 0.,    6.*l*n,  4.*ll*n,   0.,   -6.*l*n,  2.*ll*n },
 { -m,        0.,       0.,    m,        0.,       0. },
 { 0.,  -12.  *n, -6.*l *n,   0.,   12.  *n, -6.*l *n },
 { 0.,    6.*l*n,  2.*ll*n,   0.,   -6.*l*n,  4.*ll*n }}
than this:
{{m, 0, 0, -m, 0, 0},
{0, 12 * n, 6 * ln, 0, -12 * n, 6 * ln},
{0, 6 * ln, 4 * lln, 0, -6 * ln, 2 * lln},
{-m, 0, 0, m, 0, 0},
{0, -12 * n, -6 * ln, 0, 12 * n, -6 * ln},
{0, 6 * ln, 2 * lln, 0, -6 * ln, 4 * lln}}

....
cheers
d

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Rafael Henrique Moreira | 28 Jan 05:59 2015
Picon

A brand new high productivity framework for writing REST services.

I'm happy to present you one project I'm working on for the last 4 months. It's a new concept about how do we develop web services.

First I need to tell you that I'm a Brazilian guy that loves to program but I still have a bad english, please disconsider some mistakes.

The basis of this project is a mapping of a Go struct tree, constructing routes for access its REST methods. And also, injecting the dependencies this method has to answer the request.

Please take some time to take a look on the project: github.com/resoursea/api

I would imagine a near future with a lot of interfaces and Resources implementations and the developer will just choose which one can solve his problem and building the struct if his API. From this idia I created the name ResourSea, a Sea of Resources. =)

Please let your opinion, doubts or sugestions, I still developing it and your opinion is invaluable for me, and again, sorry for my poor english.

regards,
Rafael Moreira

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
James Watson | 28 Jan 11:35 2015
Picon

High Quality HTML Videos Tutorials at ITeLearn

Get complete grip on HTML language with ITeLearn high quality video tutorials by expert instructors. ITeLearn is a renowned for providing best training for HTML, making students to update with the latest technologies. This is the best platform to discover useful insights which will help you to master in HTML subject and to advance your career in the field.ITeLearn help to master the tools and help one for today’s job market. Hence make your testing career more fruitful by joining at ITeLearn.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Péter Szilágyi | 28 Jan 09:18 2015
Picon

Streaming buffered copy (proposal-ish)

Hi all,

  I've hit an interesting problem, and I was a bit surprised that there isn't anything in the standard libs that could have solved it easily. It isn't too complicated to write, but it isn't trivial either. If by any chance it's already in the libs, please enlighten me :), otherwise would anyone be interested in including it?

  The thing I was solving is fairly trivial: download a file from the internet, and stream-upload it somewhere else (Google Cloud Storage specifically, but it doesn't really matter). The naive solution is pretty straightforward: wire together the downloader's reader with the uploader's writer, and voila, magic... until you look at the network usage: x1 secs download, y1 secs upload, x2 secs download, y2 secs upload.

  The problem is, that the uploader will read some fixed amount of data, buffer it up and then start the upload. But while the upload is in progress, it doesn't read any more data from the reader, essentially pausing it until it finishes. By that time the reader could have filled up the next buffer to send, but alas, it was blocked so it didn't download anything.

  Note, buffered readers/writers won't really solve this issue, since even though they have the buffers in place to store arriving data, those buffers cannot be simultaneously filled and flushed too. As far as I figured it out, the only way to solve this streaming problem is to have to concurrent go routines, one reading and another writing, with a data buffer in between.

  If there is indeed no such thing, would it be worthwhile to add something like?

bufio.Copy(dst io.Writer, src io.Reader, buffer int) (written int64, err error)

  Which essentially does what io.Copy does, but starts up a separate writer go routine and passes everything through a user definable buffer. Then it could handle both data bursts as well batching readers/writers.

  Comments/feedback? :)

Cheers,
  Peter

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Matt Sherman | 28 Jan 05:20 2015
Picon

types.Check proceeding in the presence of errors

I am wondering if there might be a mode/config in for types.Check where types can be correctly evaluated in the presence of a certain class of error. Imagine this snippet:

var Foo DoesntExist

type Bar int

In this case, DoesntExist is undeclared, a compilation error. The AST is valid and parses fine.

It seems to me that Bar can be evaluated correctly as a type -- the error does not logically prevent its evaluation. However, types.Check will return an error since the program overall is incorrect.

Is there a technique whereby types.Check could proceed in the presence of this error? Which is to say, to get the type info for Bar regardless of the error.

The reason I ask is for codegen (my gen stuff), it often happens that one is in the above state, with usages of types that have yet-to-be-generated. It'd be a nice feature to proceed in the presence of errors that don't logically prevent otherwise-unrelated type evaluation.

(Or, perhaps my assumption about this being logically possible is incorrect.)

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Tong Sun | 28 Jan 04:11 2015
Picon

Any Nim user here?

Hi, 

Have you heard of or tried with Nim before? 

Is it true that Nim runs twice as fast as Go, or it is just that simple code that blogger chose runs fast? 
(Ref: http://hookrace.net/blog/what-is-special-about-nim/#good-performance). 

Feature like those that enable binding to your favorite C functions and libraries, or controlling the garbage collector by telling the garbage collector when and for how long it is allowed to run, etc, can be really handy. Anyone know why such fast & sweat language never took off? 

Thanks for your comments. 


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
小菜 | 28 Jan 03:45 2015
Picon

[go-nuts] How to implement a lock free shared memory queue?

How to implement a lock free shared memory queue?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Eric Z | 28 Jan 02:50 2015
Picon

json package only output capitalized struct items

Hello Golang-nuts,

Is there anyway I can force the json package to output non-capitalized items for compatibility?

I'm hoping to get the following json message {"foo":1.0, "bar":"A string"}.

However, when I defined
typed MyStruct struct {
foo float64
bar string
}
json package would ingore all non-capitalized items...

Thanks a lot.

Cheers,
Eric

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Oscar Swanros | 28 Jan 00:31 2015
Picon

Self referencing many2many relationship with Gorm

package main

import (
"github.com/jinzhu/gorm"
)

type User struct {
Id int64
Contacts []User `gorm:"many2many:user_contacts;"`
}


func main() {
fmt.Println("Hello, playground")
}

// Getting "pq: column "user_id" specified more than once"
// How to define a self-referencing relationship using gorm?

How can this be achieved?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Mark B. | 28 Jan 00:26 2015
Picon

How can Go execute a method of a nil pointer?

The function:

        func (p *P) ID() int {
                fmt.Println("p =", p)
                return p.id
        }

outputs "p = <nil>" before panicking
with a "nil pointer dereference".

How can a nil pointer run it's method?
What is happening here?  

I would have expected the panic on the call to ID(), 
not the execution.

(See https://play.golang.org/p/KGCI65RL2z for full snippet.)

Thanks!

Mark

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Eric Z | 28 Jan 00:13 2015
Picon

what is the best way to handle ^M in windows files

Hello Golang-nuts,

I'm handling some windows files with golang on linux. Is there any libraries or calls that I can easily deal with the windows line breaks ? Otherwise, I won't even been able to print out the file. Thank you!

Cheers,
Eric

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

Gmane