[go-nuts] CFG for a Go program

2016-11-25 Thread Tamás Gulácsi
What the hell is a CFG?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] CFG for a Go program

2016-11-25 Thread akshanshchahal
Hi,

I need the CFG for a Golang Program.
Any suggestions about which way can I access the CFG.

Thank you

Akshansh 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Phil Snowberger
What /u/spez did was not "inane" or "immature".  If he had replied to the 
comments, insulting the commenter's mother's face or something, that would 
be inane and immature.

Modifying a user's comments, putting words in their mouth, is fundamentally 
a completely different thing.  It is intellectually dishonest, 
unconscionable, disgusting.

On Friday, November 25, 2016 at 10:26:23 AM UTC-8, Nate Finch wrote:
>
> Please note that Brad has since posted on Hacker News that he no longer 
> wants to delete r/golang, but simply make it unofficial: 
> https://news.ycombinator.com/item?id=13037636
>
> I think this is perfectly fine.  Honestly, I don't think many people felt 
> that anything on reddit was official.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Graham Anderson
Hello,

I'm abjectly torn. I understand and agree that there are strong moral
boundaries and trust realms that have been broken.

Simply put, reddit has become digg, the shame...

I also understand (and firmly believe) that the moderation of the reddit
/r/golang community has been lackadaisical at best. At its worst it's
negligent.

It also exists solely at *our* pleasure... Not yours, little blue Google
gophers. Except maybe Damian Gryski, to whom you owe a debt of gratitude.

Graham

On 24 Nov 2016 11:54 pm, "Brad Fitzpatrick"  wrote:

> [+bketelson, dgryski]
>
>
> On Thu, Nov 24, 2016 at 3:53 PM, Brad Fitzpatrick 
> wrote:
>
>> In light of the CEO of Reddit admitting to editing user comments (see
>> dozen news stories today), I propose we delete the /r/golang subreddit.
>>
>> That is so beyond unethical and immature, I no longer want anything to do
>> with that site. I will be deleting my account on Reddit after backing up my
>> content, and I will no longer be a moderator of /r/golang.
>>
>> If other moderators of /r/golang feel strongly that it should remain, I
>> suppose you're welcome to keep it going.
>>
>> But if the other moderators want to abandon it and focus our conversation
>> elsewhere (or build a replacement), I'm happy to just delete /r/golang.
>>
>> Opinions?
>>
>>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: manage returned err, , := func() ?

2016-11-25 Thread mhhcbon
agreed, within the std lib, or any package to be consumed, panic is not 
right.

In the case i m dealing with now, 
web application controller, 
with resources that it is not interesting to retry (db, fs , session),
it does look like to me there s not much to do except
1- log
2- die
3- recover to print a gone south message

the logic for 1 & 2 is heavily cluttering the code
when within the same 50 lines the program has to
begin a transaction
read db,
write db
commit the db
write a file
save session
+ additional logic to make the program actually useful to human

In the suggestion i made 1 a 2 can be 
embedded, 
behaviored,
parametrized, 
and un-clutter the code with a one liner.

Sometimes MustFunc does not seem so good,
there are func that can fail fatal, but that are used only once (database 
data provider?),
should we add a MustFunc, that means clutter that func parameters, 
or instance of provider with an additional logging logic to be duplicated 
as many times as a MustFunc should exist.

About the logging case, i m not sure i got you right, 
i suspect a lack of creativity.


On Friday, November 25, 2016 at 10:08:37 PM UTC+1, Volker Dobler wrote:
>
> Am Freitag, 25. November 2016 15:49:00 UTC+1 schrieb mhh...@gmail.com:
>>
>> Does it make any sense to you too ?
>>
>
> No. Sorry.
>
> For the rare cases where a panic is appropriate you can easily
> provide Must... functions (see package template or regexp).
> For other cases panicking is not appropriate.
>
> For the logging case: Please no. This is just ignoring the error
> in disguise. And it often wouldn't work out: Lots of functions have
> no sensible return on error, e.g. http.Get requires different control
> flow depending on err being nil or not.
>
> All such ideas have been discussed and are not better then
> the status quo.
>
> V.
>
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Error Handling

2016-11-25 Thread Dave Cheney
Would a type switch do what you want ?

err := fn()
switch err := err.(type) {
case nil:
   // all good
case *MyCustomError:
   // do something custom
default:
   // unexpected error
}

On Saturday, 26 November 2016 05:07:55 UTC+11, Parveen Kumar wrote:
>
> Hi Team,
>
> I want to catch my custom error being returned from various methods and 
> based on their type i want to return http error code. is ther any generic 
> way?
>
> Regards,
> Parveen Kumar
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-25 Thread Dave Cheney


On Saturday, 26 November 2016 08:00:24 UTC+11, Roger Alsing wrote:
>
> So it works very similar to normal OS thread context switching, but more 
> explicit?
>

Yes, goroutine switching occurs a known points; effectively where the 
goroutine is blocked from proceeding; sending and receiving on channels (if 
they are full/empty respectively), trying to acquire a locked mutex, and 
performing IO. These operations happen frequently in a program that 
interacts with others so things more or less work out.
 

> The code will push all local state to the go routine stack, pop the state 
> for the next go routine and change the stack pointer?
>

The cute thing is the Go function call convention is caller save, so when a 
goroutine enters the scheduler there is no state to be saved, it's already 
saved on the stack by the normal function call convention. As Ian said 
above the scheduler just finds the SP and PC for a new goroutine and swaps 
them for the current one. The new goroutine awakes at the bottom of the 
scheduler, and returns to its original control flow.
 

>
> And this is cheaper than context switching as threads have their own 1 or 
> 4 mb stack allocated while go routines have a linked list for its stack 
> (afaik?) ?
>

Goroutines used to have a linked list of stack segments, we dropped that in 
Go 1.3 (might have been 1.2, i'd have to check), now stack segments grow 
and shrink with a cheap check in the preamble of the function; if there 
isn't enough stack to perform the function (this is known precisely at 
compile time), then the function traps into a slow path that doubles the 
stack allocation by copying the whole stack to a new area, then restarts 
the function. Stack shrinking is handled via the GC cycle when a goroutine 
has a large amount of unused stack.
 

> is that the major difference?
>

I think so, it makes goroutines cheap to create; only a few kb of initial 
stack, cheap to use; no trip through kernel space to save a lot of state, 
and trash TLB's and caches, and cheap to have many of them; in operation 
hundreds of thousands of goroutines in a busy server are the norm. This is 
also pretty much the case against threads.

Here is a presentation I gave at OSCON last year about all these 
things, https://dave.cheney.net/2015/08/08/performance-without-the-event-loop
 

>
>
> Den fredag 25 november 2016 kl. 17:34:24 UTC+1 skrev Ian Lance Taylor:
>>
>> On Fri, Nov 25, 2016 at 2:18 AM,   wrote: 
>> > I have seen a lot of confusion on how go routines actually work 
>> internally. 
>> > Will the function execution ontop of the go routine be rewritten to a 
>> statemachine with continuations in the same way as the C# async await does? 
>>
>> I do not know how C# async await works.  That said, goroutines are not 
>> rewritten to state machines. 
>>
>>
>> > If I have only 1 OS thread and 1000 go routines, obviously there must 
>> be some sort of "magic" that makes it possible to multiplex these ontop of 
>> that thread. 
>> > How do the go routines store state so that they can continue from the 
>> last execution point when they resume execution? 
>>
>> A goroutine is basically a small stack.  All the goroutine state is 
>> saved on the stack.  To switch to a different goroutine, the goroutine 
>> scheduler changes the stack pointer.  On the new goroutine, it looks 
>> like the function call into the scheduler simply returns, and the 
>> goroutine continues running. 
>>
>> This is a standard programming technique known as a "coroutine".  For 
>> Go we used the name "goroutine" because 1) it is cute; 2) goroutines 
>> have functionality not available in most coroutine libraries, such as 
>> multiplexing across many OS threads and automatic use of epoll for 
>> network connections. 
>>
>>
>> > Is it safe to say that Go gives you the exact same support as the C# 
>> (and others) async await while still writing code that looks sequential? 
>>
>> I don't know C#.  goroutines let you write code that looks sequential 
>> because it actually is sequential. 
>>
>> Ian 
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-25 Thread Matt Ho
Goroutines are conceptually very similar to threads, but much lighter weight.  
They are far cheaper than system threads to run.  It's not uncommon for go apps 
to have 50k or more goroutines running.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: manage returned err, , := func() ?

2016-11-25 Thread Volker Dobler
Am Freitag, 25. November 2016 15:49:00 UTC+1 schrieb mhh...@gmail.com:
>
> Does it make any sense to you too ?
>

No. Sorry.

For the rare cases where a panic is appropriate you can easily
provide Must... functions (see package template or regexp).
For other cases panicking is not appropriate.

For the logging case: Please no. This is just ignoring the error
in disguise. And it often wouldn't work out: Lots of functions have
no sensible return on error, e.g. http.Get requires different control
flow depending on err being nil or not.

All such ideas have been discussed and are not better then
the status quo.

V.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-25 Thread Roger Alsing
So it works very similar to normal OS thread context switching, but more 
explicit?
The code will push all local state to the go routine stack, pop the state 
for the next go routine and change the stack pointer?

And this is cheaper than context switching as threads have their own 1 or 4 
mb stack allocated while go routines have a linked list for its stack 
(afaik?) ?
is that the major difference?


Den fredag 25 november 2016 kl. 17:34:24 UTC+1 skrev Ian Lance Taylor:
>
> On Fri, Nov 25, 2016 at 2:18 AM,   
> wrote: 
> > I have seen a lot of confusion on how go routines actually work 
> internally. 
> > Will the function execution ontop of the go routine be rewritten to a 
> statemachine with continuations in the same way as the C# async await does? 
>
> I do not know how C# async await works.  That said, goroutines are not 
> rewritten to state machines. 
>
>
> > If I have only 1 OS thread and 1000 go routines, obviously there must be 
> some sort of "magic" that makes it possible to multiplex these ontop of 
> that thread. 
> > How do the go routines store state so that they can continue from the 
> last execution point when they resume execution? 
>
> A goroutine is basically a small stack.  All the goroutine state is 
> saved on the stack.  To switch to a different goroutine, the goroutine 
> scheduler changes the stack pointer.  On the new goroutine, it looks 
> like the function call into the scheduler simply returns, and the 
> goroutine continues running. 
>
> This is a standard programming technique known as a "coroutine".  For 
> Go we used the name "goroutine" because 1) it is cute; 2) goroutines 
> have functionality not available in most coroutine libraries, such as 
> multiplexing across many OS threads and automatic use of epoll for 
> network connections. 
>
>
> > Is it safe to say that Go gives you the exact same support as the C# 
> (and others) async await while still writing code that looks sequential? 
>
> I don't know C#.  goroutines let you write code that looks sequential 
> because it actually is sequential. 
>
> Ian 
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: goroutine scheduler is a trap?????!!!!!

2016-11-25 Thread Didier Spezia
Any non trivial program is scalable up a certain point.
In your code, you may have some contention.
It can be physical (CPU, memory, network, disks, etc ...) or logical 
(mutexes, channels, shared memory, etc ...)
If it is not in your own code, then perhaps it may be in the packages you 
use, including the Go standard libraries or the runtime itself.
The exact cause is difficult to guess, that's why profiling is useful.

Also, the Go scheduler is currently not NUMA aware. It does not exploit 
well the locality in a machine having multiple sockets.
On a two sockets box, it is usually more efficient to run two instances of 
the application. and pin them to their own NUMA node, rather than one 
single instance sharing all the CPUs.

Regards.
Didier.

On Thursday, November 24, 2016 at 10:02:21 PM UTC+1, 3702...@qq.com wrote:
>
> today i am testing my service(something like cdn).system is centos 
> 6.5,memory=32GB,bandwidth=10Gb and 4000 live stream.one mechine is 16-core 
> cpu and the other is 8-core cpu.the testing result makes me feel 
> upset,16-core cpu mechine run  about 1000% cpu and play is not smooth,but 
> the 8-core cpu mechine run about 600% cpu and play 
> smooth!!!why?could someone help??help me
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Framework for application level metric in go

2016-11-25 Thread Victor Vrantchan
Take a look at the go-kit/kit/metrics package. 
https://godoc.org/github.com/go-kit/kit/metrics

The examples folder in the repo has some good usage examples with various 
metrics providers. 

On Friday, November 25, 2016 at 1:07:55 PM UTC-5, Parveen Kumar wrote:
>
> Hi Team,
>
> is there any tool or framework in golang which can be used to get 
> application level metrics like hit on api or turn around time, etc.
>
> Regards,
> Parveen Kumar
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Nate Finch
Please note that Brad has since posted on Hacker News that he no longer 
wants to delete r/golang, but simply make it 
unofficial: https://news.ycombinator.com/item?id=13037636

I think this is perfectly fine.  Honestly, I don't think many people felt 
that anything on reddit was official.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread Micky
I don't think people realize the gravity of the situation, of what Brad
pointed out.

If I said something (which in reality I never said) and if someone responds
back to me in a way (which they never did), it could have serious
implications on the parties conversing on a topic -- particularly when the
nature of conversation is, software!

(I know people will say they are other mediums of communication but think
of security issues, etc.)

On Fri, Nov 25, 2016 at 4:53 AM, Brad Fitzpatrick 
wrote:

> In light of the CEO of Reddit admitting to editing user comments (see
> dozen news stories today), I propose we delete the /r/golang subreddit.
>
> That is so beyond unethical and immature, I no longer want anything to do
> with that site. I will be deleting my account on Reddit after backing up my
> content, and I will no longer be a moderator of /r/golang.
>
> If other moderators of /r/golang feel strongly that it should remain, I
> suppose you're welcome to keep it going.
>
> But if the other moderators want to abandon it and focus our conversation
> elsewhere (or build a replacement), I'm happy to just delete /r/golang.
>
> Opinions?
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Error Handling

2016-11-25 Thread Parveen Kumar
Hi Team,

I want to catch my custom error being returned from various methods and 
based on their type i want to return http error code. is ther any generic 
way?

Regards,
Parveen Kumar

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Framework for application level metric in go

2016-11-25 Thread Parveen Kumar
Hi Team,

is there any tool or framework in golang which can be used to get 
application level metrics like hit on api or turn around time, etc.

Regards,
Parveen Kumar

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread idigix
So CEO spends an hour modifying some comments that were personally insulting 
him, yes pretty bad, but makes no sense to conclude site is bullshit because of 
that. It is not like he even hid the fact, just admitted it for no reason. 
Still bad, but could be a lot lot lot worse.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Hide struct fields from frontend code (JSON REST API)

2016-11-25 Thread derickcyril
This will work for you:

type User struct {
  Name string `json:"name"`
  PasswordHash string `json:"-", db:"passwordHash"`
}


Thank you,
Derick

On Friday, November 25, 2016 at 8:35:13 PM UTC+5:30, Mirco Zeiss wrote:
>
> Yeah, I know. But how do I keep the private fields when talking to my 
> database?
>
> On Friday, November 25, 2016 at 2:04:58 PM UTC+1, Tamás Gulácsi wrote:
>>
>> Yoz can create a MarshalJSON method on the struct (type), that filters 
>> out private fields, based on either field name, or a field tag.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: net/http and errors.

2016-11-25 Thread Victor Vrantchan
In Go, you can check if a type satisfies a particular behavior by declaring 
an interface, and then checking if the type satisfies that interface. 
In your case, you can check if the error is `Temporrary()` or not. 

See this snippet as an example: https://play.golang.org/p/Ffyg61iDpB

I 
recommend 
https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully
 
and.or the GopherCon talk https://www.youtube.com/watch?v=lsBF58Q-DnY by 
Dave Cheney for a more in-depth presentation of this idea. 

On Friday, November 25, 2016 at 12:00:06 PM UTC-5, mb.dha...@gmail.com 
wrote:
>
> This is a question about the net/http API, Googling was not very helpful.
>
> _, err := http.Get("https://random_non_existing_domain.com;)
>
>
> Following code will obviously fail, but how can I check if it failed 
> because of DNS error not because a billion other things that might have 
> gone wrong?
>
> I tried this, (mostly as a shot in the dark)
>
> if e, ok := err.(net.Error); ok {
> fmt.Println("dial error", e.Temporary())
> }
> if e, ok := err.(*net.AddrError); ok {
> fmt.Println("addr rror", e.Temporary())
> }
> if e, ok := err.(*net.DNSError); ok {
> fmt.Println(e)
>
> and it seems to print 
>
>dial error false
>
> Is there any easy way to do what I'm trying to achieve?
>
> -
> dbalan
> @notmycommit
>
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] net/http and errors.

2016-11-25 Thread mb . dhananjay
This is a question about the net/http API, Googling was not very helpful.

_, err := http.Get("https://random_non_existing_domain.com;)


Following code will obviously fail, but how can I check if it failed 
because of DNS error not because a billion other things that might have 
gone wrong?

I tried this, (mostly as a shot in the dark)

if e, ok := err.(net.Error); ok {
fmt.Println("dial error", e.Temporary())
}
if e, ok := err.(*net.AddrError); ok {
fmt.Println("addr rror", e.Temporary())
}
if e, ok := err.(*net.DNSError); ok {
fmt.Println(e)

and it seems to print 

   dial error false

Is there any easy way to do what I'm trying to achieve?

-
dbalan
@notmycommit


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Question about flow of context

2016-11-25 Thread Diego Bernardes
Got one question about the design of some packages using the new 'context' 
in golang. Let's assume we have a webserver, when some request get in, we 
can get the context from request, and this request can trigger several 
packages.
What is the best way to send this context to the other packages? Pass a 
reference to it? Or pass a inner facet with something like 'WithValue'?

I need to permeate the context to all the functions a web request can 
trigger inside the application, this is used to generate logs, metrics, 
errors, etc...

What is the best aproach to solve this issue?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread Michael Christenson II
Proof of the vibrancy of the community can be partially established by how many 
posts you received on this post, versus the Reddit thread. While this post is 
one of the most responded to posts on this user group of late, the comments on 
the Reddit thread dwarf it by far. Consider the impact of that in your 
decisions please.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-25 Thread Ian Lance Taylor
On Fri, Nov 25, 2016 at 2:18 AM,   wrote:
> I have seen a lot of confusion on how go routines actually work internally.
> Will the function execution ontop of the go routine be rewritten to a 
> statemachine with continuations in the same way as the C# async await does?

I do not know how C# async await works.  That said, goroutines are not
rewritten to state machines.


> If I have only 1 OS thread and 1000 go routines, obviously there must be some 
> sort of "magic" that makes it possible to multiplex these ontop of that 
> thread.
> How do the go routines store state so that they can continue from the last 
> execution point when they resume execution?

A goroutine is basically a small stack.  All the goroutine state is
saved on the stack.  To switch to a different goroutine, the goroutine
scheduler changes the stack pointer.  On the new goroutine, it looks
like the function call into the scheduler simply returns, and the
goroutine continues running.

This is a standard programming technique known as a "coroutine".  For
Go we used the name "goroutine" because 1) it is cute; 2) goroutines
have functionality not available in most coroutine libraries, such as
multiplexing across many OS threads and automatic use of epoll for
network connections.


> Is it safe to say that Go gives you the exact same support as the C# (and 
> others) async await while still writing code that looks sequential?

I don't know C#.  goroutines let you write code that looks sequential
because it actually is sequential.

Ian

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread Tom Cameron
This is the most ridiculous, short sighted, and I'll advised thing I've seen 
suggested on this list for a while.

Are we also going to remove every article written about go in a newspaper, 
magazine, or blog because editors and journalists did something idiotic? 
Because if that's the case, we're going to have to do a lot of cleanup. And 
we're basically going to have to burn hackernews to the ground (not a bad idea, 
but I'd still have a problem with it).

If you don't support what happens on Reddit (this is far from their first 
scandal) then don't use it. That's the best part of freedom of choice. But I 
don't see too many alternative forums for people to use, so you're going to 
have to come up with something better than mailing lists and news groups before 
pulling the plug.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Why doens't function type support comparision but channel type does?

2016-11-25 Thread Ian Lance Taylor
On Thu, Nov 24, 2016 at 6:01 AM, T L  wrote:
>
> On Thursday, November 24, 2016 at 8:16:49 AM UTC+8, Ian Lance Taylor wrote:
>>
>> On Wed, Nov 23, 2016 at 3:49 PM, roger peppe  wrote:
>> > Ian, what you say is true, but is also true of types and other objects
>> > too,
>> > I think. I found some interesting anomalies playing around with the new
>> > plugin package.
>>
>> We've worked hard to make sure that what I said earlier is not true of
>> types, even in the presence of shared libraries.  If we've failed,
>> please file bugs.  Even with plugins it should work correctly.
>
>
> so os.File from a plugin is the same as the os.File in the host program?
> how do we know the os package from a plugin is the same package in the host
> program?

In a Go program, the path used in the import statement uniquely
defines a package.  If you write a plugin that breaks that rule, your
plugin will not work correctly.

Ian

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread erick . romero . dev
The depressing unintended consequence of this is that a rift has been created 
between community leaders and r/golang users (Who happened to see the post). 

I recently entered r/golang because I already used a couple other subreddits 
that perform a function similar to an RSS feed. Simple content aggregation. But 
I was already using the platform so r/golang became a valuable entry point. 
Removing this entry point, at the very least, seems shortsighted. 

Coming back to the riff: The unintended consequence of actions such as 
proposing the removal of the subreddit, outside of the subreddit, no less. Is 
that you entrench people in their points. Reddit people see this as a personal 
action against them, they come retaliate here. People here feel attacked, they 
entrench themselves in their views. Essentially this creates an "Us vs Them" 
mentality. 

As community leaders you must try to be aware of the impact your words will 
have on said community. I am still a beginner. r/golang was my entry point but 
the likely logical evolution would've likely put me either here or in the 
Google Group eventually as I got more comfortable with the language. Now, this 
seems less probable. Not because I think the discussion here is less, or more 
valuable, but because when I was in reddit and then "We faced destruction! 
Together!" against "The Go team members who wanted to destroy us!", this 
creates a very ugly bias. 

Fragmentation of a community, however unintended, should be something that 
leadership should very consciously try to avoid. Rooting people in their 
communities, effectively hamstringing horizontal mobility between platforms due 
to bias is a serious problem. 

Even if you see the reddit community as an inferior option compared to the 
others, it's important realize that it serves a purpose. As leaders you must 
try to be more magnanimous and practice tolerance. In the end we're all 
participating in one way or another because we love the language, and want to 
learn and see more. 

Additional Resource:
HackerNews is also talking about this: 
https://news.ycombinator.com/item?id=13036890

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Michael Christenson II
I'm baffled at the people that agree to lessen the voice of Go. If Reddit is 
not suited to your taste or morals, that's understandable, continue down the 
road of creating an official alternative, but don't shut down a positive space 
in a very large world because you find the actions of the owner of that world 
distasteful. It would be a vicious attack against those using it and serve no 
point outside of political maneuvering. Don't hurt the community, simply step 
down please.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Jaana Burcu Dogan
Please, find a better solution. Don't delete years of discussion and 
curated content. And, the Go subreddit is the work of the community over 
there and this question should be directed at them.

Minimizing the involvement and making it a unofficial space should be the 
first attempt. An unofficial and unmaintained r/golang doesn't sound as bad 
as a deleted one.

(As a side note, I am scared how our generation has normalized ethically 
corrupt actions from the authority and trying to hack around it rather than 
leaving in protest. I stopped using Reddit under my own name many years ago 
due to similar reasons.)

On Thursday, November 24, 2016 at 3:53:32 PM UTC-8, bradfitz wrote:
>
> In light of the CEO of Reddit admitting to editing user comments (see 
> dozen news stories today), I propose we delete the /r/golang subreddit.
>
> That is so beyond unethical and immature, I no longer want anything to do 
> with that site. I will be deleting my account on Reddit after backing up my 
> content, and I will no longer be a moderator of /r/golang.
>
> If other moderators of /r/golang feel strongly that it should remain, I 
> suppose you're welcome to keep it going.
>
> But if the other moderators want to abandon it and focus our conversation 
> elsewhere (or build a replacement), I'm happy to just delete /r/golang.
>
> Opinions?
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Struct field updefined Build Error

2016-11-25 Thread Jan Mercl
On Fri, Nov 25, 2016 at 4:42 PM Chris S  wrote:

type AggInfoXml struct {
Percent IntPercent `xml:"taskprogress,omitempty"`
IpAddr []Addr `xml:"host>address,omitempty"`
}

...

for _, port := range aggInfoXml.IpAddr.Hports {
fmt.Printf("Port: %s\n", port.ports())
}

aggInfoXml.IpAddr is of type []Addr, ie it's a slice. Slices do not have
fields, structs have. You probably forgot to use an index:

for _, port := range aggInfoXml.IpAddr[someIndexExresion].Hports {
fmt.Printf("Port: %s\n", port.ports())
}


-- 

-j

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread jamesmcminn
What a knee-jerk reaction. An admin does one stupid thing so it's suddenly time 
to abandon one of the most popular websites in the world?

Honestly, I don't think the subreddit should ever have been "official". No one 
expects anything on reddit to be an official support channel. It wasn't created 
as one - instead it was slowly taken over by members of the Go team and turned 
into one.

Reading this thread, there's clearly contempt for /r/golang from the Go team 
and high-profile members of the community, and that's really sad to see, 
because it shows contempt for a large part of the Go community that use it.

The current set of moderators do the job of moderating it, but nothing more - 
it's just an annoying distraction for them. /r/Golang has its issues, but it's 
very possible for a programming language subreddit to foster a great community, 
and plenty of them do. However, that takes time and effort on the part of the 
moderation team, which frankly I don't think the current team is able to 
provide.

Hand the subreddit over to the community - everyone will be happier. A reddit 
admin edited extremely insulting posts aimed directly at him and calling him a 
paeodphile is not a reason to delete /r/golang, it's simply a bad excuse. 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread dwin
The community makes these decisons, not the Mods otherwise what makes you 
different than the CEO. 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread hrj . nzym
Laughable, coming from a guy who has turned Livejournal into a Russian 
Intelligence collection tool.

Shut the fuck up already

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Inevitable unexpected EOF

2016-11-25 Thread Connor
Hi all.

I'm trying to implement a structure which gzips multiple 
individually-inflatable messages in the same data stream. I've built an 
example implementation here: https://play.golang.org/p/hwdrVtI29t. While 
this works initially, eventually the gzip reader throws an "unexpected EOF" 
at me. I've tracked the problem down to L609 in compress/flate/inflate.go 
; the value returned 
by f.dict.availWrite() reaches zero, causing the reader to transition from 
the nextBlock "state" to reading huffmanBlock, ending in an unexpected EOF. 
For what it's worth, I've also tested it with this 
 LZ4 package which provides almost the same 
API as compress/gzip, and it works flawlessly.

Could someone provide some pointers here? Is this the result of my own 
limited understanding of gzip/DEFLATE's mechanics, or is this possible a 
flaw in compress/(flate|gzip)?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Peter Mellett
I have to agree with this poster.

I'm an experienced developer but reasonably new to Go.

Frankly nothing about the subreddit indicates that it's official. I suggest 
that the Go team withdraw from moderating the subreddit if they do not 
agree with recent events on reddit itself. Leave a note in the sidebar that 
it's an unofficial subreddit and allow the reddit /r/golang community to 
moderate.

Unnecessary politicking is unsavoury and makes Go feel like an unwelcoming 
community. I simply don't see how proposing to punish the community around 
your programming language is appropriate or considerate.

On Friday, November 25, 2016 at 5:39:41 AM UTC, n8he...@gmail.com wrote:
>
> This is my first post here. I wouldn't have known about the thread if it 
> weren't for r/golang. 
>
> I'm interested in learning more about the language, but as a very green 
> hobbyist without much free time, much of my Go news comes from interesting 
> tidbits that come up in gotimefm, hacker news, and most of all r/golang. 
>
> I would definitely be bummed if r/golang went away. 
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-25 Thread rogeralsing
I have seen a lot of confusion on how go routines actually work internally.
Will the function execution ontop of the go routine be rewritten to a 
statemachine with continuations in the same way as the C# async await does?

If I have only 1 OS thread and 1000 go routines, obviously there must be some 
sort of "magic" that makes it possible to multiplex these ontop of that thread.
How do the go routines store state so that they can continue from the last 
execution point when they resume execution?
Is it safe to say that Go gives you the exact same support as the C# (and 
others) async await while still writing code that looks sequential?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Field undefined error when trying to compile go file for parsing xml's

2016-11-25 Thread Chris S
Hi,

 I am working on trying to parse an xml file with my go code. But I keep on 
getting an error saying:

./main_v4.go:155: aggInfoXml.IpAddr.Hports undefined (type []Addr has no 
field or method Hports)

Any thoughts on why this is happening?

Here is my code

package main

import (

"net/http"
"html/template"
"os/exec"
"io/ioutil"
"os"
"encoding/xml"
"encoding/json"
"fmt"
"bufio"
"github.com/gorilla/websocket"
"time"
"log"

)

type PercentInfo struct {
Percent IntPercent `xml:"taskprogress,omitempty"`
} 

type AggInfoXml struct {
Percent IntPercent  `xml:"taskprogress,omitempty"`
IpAddr  []Addr  `xml:"host>address,omitempty"`
}

type IntPercent struct {
Value float64 `xml:"percent,attr,omitempty"` // works
}


type Addr struct {
Ip  string   `xml:"addr,attr"`
Hports  []Ports  `xml:"host>ports>port,omitempty"` //failing to be 
recognized
}

type Ports struct {
Port string `xml:"portid,attr"`
}

func (p *Addr) ipaddr() string {
 return p.Ip
}

func (p *Ports) ports() string {
 return p.Port
}

func (p *IntPercent) percent() float64 {
return p.Value
}

func (f *Test) Name() string {
return f.Value

}

var upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
}

type Test struct {
Value string
}


func wsHandler(w http.ResponseWriter, r *http.Request) {

conn, err := upgrader.Upgrade(w, r, nil)
if err != nil {
fmt.Println(err)
}

cmd := exec.Command("nmap", "-F", "-sS", "172.16.2.0/24", "-oX", 
"output.xml", "--stats-every", "1s")

if err := cmd.Start(); err != nil {
log.Fatal(err)
}

time.Sleep( 1000 * time.Millisecond) 

fp, err := os.Open("output.xml")
if err != nil {
log.Fatal(err)
}


// create scanner on the output.xml file
in := bufio.NewScanner(fp)

// change this loop to buffer read the xml file...
aggInfoXml  := AggInfoXml{}



fmt.Printf("hello")

for in.Scan() {

err = xml.Unmarshal([]byte(in.Text()), ) // this 
is not working..
if err != nil {
fmt.Printf("Could not unmarshal the line <%v>", in.Text())
} else {
fmt.Printf("%+v\n", aggInfoXml.Percent.Value) // this is not 
working? why .percent()
}

// bail out of slow loop if 100% reached
if aggInfoXml.Percent.Value == 100 {
break
}

time.Sleep(1000*time.Millisecond)

bytesArray, err := json.Marshal(aggInfoXml.Percent)

err = conn.WriteMessage(websocket.TextMessage, bytesArray)  // send 
JSON over
if err != nil {
panic(err)
}

}//this is the end of the in.Scan loop now

fmt.Println("After loop")


if err := cmd.Wait(); err != nil {  
log.Fatal(err)
}

data, err := ioutil.ReadFile("output.xml")

if err != nil {
panic(err)
}

err = xml.Unmarshal(data, )
if err != nil {
log.Fatal("Could not unmarshal host")
}

for _, port := range aggInfoXml.IpAddr.Hports {
fmt.Printf("Port: %s\n", port.ports())
}

for _, ip := range aggInfoXml.IpAddr {
fmt.Printf("IpAdd: %s\n", ip.ipaddr())
}

conn.Close()
fp.Close()
}

func handler(w http.ResponseWriter, r *http.Request) {

t, _ := template.ParseFiles("index.html")
t.Execute(w,nil)
}

func main() {

http.HandleFunc("/", handler)
http.Handle("/layout/", http.StripPrefix("/layout/", http.FileServer(
http.Dir("layout"
http.HandleFunc("/websocket", wsHandler)
http.ListenAndServe(":8080", nil)

}
...


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Reto Brunner
God no!

Only because bradfitz has a problem with Reddit doesn't mean that all
others do

Squatting /r/golang and not handing moderation over would be a very unfair
move to those who liked *and still like* Reddit

If you don't wanna be a mod, fair enough, step down but leave us in peace!

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Struct field updefined Build Error

2016-11-25 Thread Chris S
Hi,

I am currently working on parsing an xml file using go structs. I have 
typed up the following code below. But for some reason when I try to 
compile it. it gives me an error saying 

./main_v4.go:155: aggInfoXml.IpAddr.Hports undefined (type []Addr has no 
field or method Hports)

I have no idea what is causing this issue. Any thoughts would be helpeful.

package main

import (

"net/http"
"html/template"
"os/exec"
"io/ioutil"
"os"
"encoding/xml"
"encoding/json"
"fmt"
"bufio"
"github.com/gorilla/websocket"
"time"
"log"

)

type PercentInfo struct {
Percent IntPercent `xml:"taskprogress,omitempty"`
} 

type AggInfoXml struct {
Percent IntPercent  `xml:"taskprogress,omitempty"`
IpAddr  []Addr  `xml:"host>address,omitempty"`
}

type IntPercent struct {
Value float64 `xml:"percent,attr,omitempty"` // works
}


type Addr struct {
Ip  string   `xml:"addr,attr"`
Hports  []Ports  `xml:"host>ports>port,omitempty"` //failing to be 
recognized
}

type Ports struct {
Port string `xml:"portid,attr"`
}

func (p *Addr) ipaddr() string {
 return p.Ip
}

func (p *Ports) ports() string {
 return p.Port
}

func (p *IntPercent) percent() float64 {
return p.Value
}

func (f *Test) Name() string {
return f.Value

}

var upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
}

type Test struct {
Value string
}


func wsHandler(w http.ResponseWriter, r *http.Request) {

conn, err := upgrader.Upgrade(w, r, nil)
if err != nil {
fmt.Println(err)
}

cmd := exec.Command("nmap", "-F", "-sS", "172.16.2.0/24", "-oX", 
"output.xml", "--stats-every", "1s")

if err := cmd.Start(); err != nil {
log.Fatal(err)
}

time.Sleep( 1000 * time.Millisecond) 

fp, err := os.Open("output.xml")
if err != nil {
log.Fatal(err)
}


// create scanner on the output.xml file
in := bufio.NewScanner(fp)

aggInfoXml  := AggInfoXml{}


fmt.Printf("hello")

for in.Scan() {

err = xml.Unmarshal([]byte(in.Text()), ) // this 
is not working..
if err != nil {
fmt.Printf("Could not unmarshal the line <%v>", in.Text())
} else {
fmt.Printf("%+v\n", aggInfoXml.Percent.Value) // this is not 
working? why .percent()
}

// bail out of slow loop if 100% reached
if aggInfoXml.Percent.Value == 100 {
break
}

time.Sleep(1000*time.Millisecond)

bytesArray, err := json.Marshal(aggInfoXml.Percent)

err = conn.WriteMessage(websocket.TextMessage, bytesArray)  // send 
JSON over
if err != nil {
panic(err)
}

}//this is the end of the in.Scan loop now

fmt.Println("After loop")


if err := cmd.Wait(); err != nil {  
log.Fatal(err)
}

data, err := ioutil.ReadFile("output.xml")

if err != nil {
panic(err)
}

err = xml.Unmarshal(data, )
if err != nil {
log.Fatal("Could not unmarshal host")
}

for _, port := range aggInfoXml.IpAddr.Hports {
fmt.Printf("Port: %s\n", port.ports())
}

for _, ip := range aggInfoXml.IpAddr {
fmt.Printf("IpAdd: %s\n", ip.ipaddr())
}

conn.Close()
fp.Close()
}

func handler(w http.ResponseWriter, r *http.Request) {

t, _ := template.ParseFiles("index.html")
t.Execute(w,nil)
}

func main() {

http.HandleFunc("/", handler)
http.Handle("/layout/", http.StripPrefix("/layout/", http.FileServer(
http.Dir("layout"
http.HandleFunc("/websocket", wsHandler)
http.ListenAndServe(":8080", nil)

}


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread schustertim96
This move is just petty and overreactive, considering the /r/golang 
community was not asked prior to this proposal, I was informed about this 
through a post from a non-moderator user.
How am I supposed to trust you ever again to not just delete a forum or any 
platform of discourse because someone did something you didn't like?

I'd ask you to step down in a role as a moderator due to an obvious 
betreyal of trust, but you seem to be doing that already.

Am Freitag, 25. November 2016 00:53:32 UTC+1 schrieb bradfitz:
>
> In light of the CEO of Reddit admitting to editing user comments (see 
> dozen news stories today), I propose we delete the /r/golang subreddit.
>
> That is so beyond unethical and immature, I no longer want anything to do 
> with that site. I will be deleting my account on Reddit after backing up my 
> content, and I will no longer be a moderator of /r/golang.
>
> If other moderators of /r/golang feel strongly that it should remain, I 
> suppose you're welcome to keep it going.
>
> But if the other moderators want to abandon it and focus our conversation 
> elsewhere (or build a replacement), I'm happy to just delete /r/golang.
>
> Opinions?
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread noname420
The most immature and unethical thing I've seen today is that this thread 
exists. Stamping your feet over something as inane as a mod abusing his powers 
on an internet forum while simultaneously abusing your powers as a mod  
threatening to delete an entire community over something out of their hands and 
that which has 0 impact on them. 

Please definitely delete your reddit account and take your hysterics somewhere 
else so 1 of the hundreds of other people who would be happy to mod golang can, 
and leave the community to live on in peace.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread georgy . dobrovolsky
I agree Reddit is a bit toxic place, but I also think it would be 
overreaction to delete /r/golang. I think it would be better to just mark 
it as 'unofficial' subreddit. 

Community != CEO.

On Friday, November 25, 2016 at 1:53:32 AM UTC+2, bradfitz wrote:
>
> In light of the CEO of Reddit admitting to editing user comments (see 
> dozen news stories today), I propose we delete the /r/golang subreddit.
>
> That is so beyond unethical and immature, I no longer want anything to do 
> with that site. I will be deleting my account on Reddit after backing up my 
> content, and I will no longer be a moderator of /r/golang.
>
> If other moderators of /r/golang feel strongly that it should remain, I 
> suppose you're welcome to keep it going.
>
> But if the other moderators want to abandon it and focus our conversation 
> elsewhere (or build a replacement), I'm happy to just delete /r/golang.
>
> Opinions?
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Vincent Rischmann
> It's a wretched hive of scum and villainy.  The Go subreddit was the only 
> thing similar to human and it is downright painful most of the time.

Way to go insulting everyone on Reddit. I'm neither scum or a "villain".
I also spend a lot of time on /r/golang and it's nowhere near painful, I
have no idea what you're seeing.

You should not delete the subreddit, it doesn't belong to the Go team.
The content comes entirely from the community and it wasn't an official
space until you made it so, asking nobody.

Give up control, ask that the new moderators state it's an unofficial
community in the sidebar and then stop caring about it.

On Fri, Nov 25, 2016, at 10:38 AM, Aram Hăvărneanu wrote:
> On Fri, Nov 25, 2016 at 7:28 AM, Brad Fitzpatrick 
> wrote:
> > I also want to understand whether the Go project considers /r/golang an
> > official space. The fact that the sidebar says "If you encounter an issue,
> > please mail cond...@golang.org" suggests to me that it IS an official space.
> 
> And this is a mistake. The /r/golang reddit was not created as an
> official Go space. The late Uriel created it, then gave mod power to
> some people, including /u/rsc from the Go team, and to some other
> people not from the Go team. People from the Go team had no
> involvement there **whatsoever** until very, very recently. Even now
> their involvement has been minimal.
> 
> At some point some /r/golang moderator from the Go team abused his
> power and decreed the /r/golang an official Go space. Nobody was
> asked, it was a hostile takeover. Some voiced their concern, but not
> for long, because, after all, the Go team are not terrible people and
> as I already mentioned, the Go team still continued to not have any
> significant level of involvement there.
> 
> > But if Go DOES consider it an official space, then I would argue it 
> > shouldn't be.
> 
> I agree here.
> 
> > And in this case, we need to decide what to do with /r/golang
> > (make it private, delete it, pass on ownership and request that
> > it be labeled unofficial in the sidebar, etc).
> 
> Pass it on to whoever, and make it clear in the sidebar that this is
> not officially associated with the Go project.
> 
> -- 
> Aram Hăvărneanu
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread thomas
google+? how about we just move to a MySpace group?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread Matt Proud
While I find Reddit and the conduct on/around it to be vile and nonredeemable, 
/r/golang is a nice addition to the community whose positives have generally 
outweighed the negatives.  Killing it unnecessarily fragments the Go community 
at-large — especially if no good alternative/transition can be offered.  
Apropos: We don't need that *now* after several acrimonious outbursts of 
immaturity in the past few weeks hurt collective morale.

Both golang-nuts and /r/golang serve two distinct purposes.  I have no problem 
with them co-existing.  Please don't suggest Slack.  The moves toward that have 
caused enough personal annoyance.

That's my _foif Rappen_ for whatever its worth.

- Matt

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Joubin Houshyar


On Thursday, November 24, 2016 at 11:39:38 PM UTC-5, Nate Finch wrote:
>
> Yes, the CEO did a really shitty thing.  If we burned down the website of 
> every company where someone in power did something shitty, we'd have no 
> websites left.  
>
>
If we do burn down the website of every company that betrayed the social 
trust and contract we'll be making room for alternatives run by responsible 
actors, and letting future entrepenoodles know exactly what the expected 
norms are in the information space.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread codeprojpub
While I understand where this is coming from, I'm asking not to do this. 
Given the recent amount of "drama" in Go community, I don't think it would 
be wise to add additional dividing factors. If Go Core team is concerned 
about their messages integrity, I think we can just remove "Official Go" 
title, and post official responses in other places (blog?). The removal of 
/r/golang will, at best, result in new "unofficial" subreddit. At worse it 
will be long a bloody debate with Reddit administration about who actually 
own rights to /golang sub. In both cases, people will lose trust and this 
will result in additional communication issues.

Currently /r/golang is mostly used for "show the project\library" and "ask 
for help \ clarification". Personally, I found several interesting projects 
during my "watch RSS" daily routine, and I would really very sad to loose 
it. It also makes easier to contact with other subreddits when the 
interesting discussion arises. It also allows some additional analytics for 
parsers. And while I agree that Reddit has people who have nothing but 
hate, the amount of decent and civilized persons who just like to talk on a 
single platform, instead of multiple separate ones, is much bigger there. 

Again - the "admins are editing messages" is bad, but deleting sub and 
those forcing many people to find a new place, or stop communicating with 
the community altogether, is worse. I think in times like this we should 
prove our first goal of CoC - "Treat everyone with respect and kindness".

Sorry for my english in advance. 

Dmitry.

пятница, 25 ноября 2016 г., 2:53:32 UTC+3 пользователь bradfitz написал:
>
> In light of the CEO of Reddit admitting to editing user comments (see 
> dozen news stories today), I propose we delete the /r/golang subreddit.
>
> That is so beyond unethical and immature, I no longer want anything to do 
> with that site. I will be deleting my account on Reddit after backing up my 
> content, and I will no longer be a moderator of /r/golang.
>
> If other moderators of /r/golang feel strongly that it should remain, I 
> suppose you're welcome to keep it going.
>
> But if the other moderators want to abandon it and focus our conversation 
> elsewhere (or build a replacement), I'm happy to just delete /r/golang.
>
> Opinions?
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread Tieson Molly
I personally like the /r/golang  subreddit for finding new projects or blog 
posts related to Go.   I prefer Google groups for more discussion.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Henrik Johansson
Relax, it was a primarily personal statement from Brad and he wanted to to
see if it was shared by others.

I am more baffled that not everyone agrees with him but that again is a
personal view...

fre 25 nov. 2016 kl 15:41 skrev :

> It is not up to the Go team to decide where the community chooses to spend
> their time. The arrogance in previous statements is staggering.
>
> The CEO changed something on a totally unrelated subreddit. Sounds like
> that incident is used to clean house for Go (get rid of Reddit); a
> political move that is simply not up to the Go team. Users may choose to
> leave reddit over the incident (personally I don't care at all), but you
> cannot force your opinion onto the users.
>
> Anyways, I bet the subreddit would be recreated quickly so that the
> current moderators achieve nothing in the end but lose their priviledges.
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Hide struct fields from frontend code (JSON REST API)

2016-11-25 Thread Mirco Zeiss
Yeah, I know. But how do I keep the private fields when talking to my 
database?

On Friday, November 25, 2016 at 2:04:58 PM UTC+1, Tamás Gulácsi wrote:
>
> Yoz can create a MarshalJSON method on the struct (type), that filters out 
> private fields, based on either field name, or a field tag.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] manage returned err, , := func() ?

2016-11-25 Thread mhhcbon
Hi,

Just an idea, not sure how to formally name it, neither i know if it was 
already suggested,

All about the writing,

logged, err := view.Auth.IsLoggedIn()
if err != nil {
panic(err)
}

Which now i write like this,
logged, err := view.Auth.IsLoggedIn()
MustNotErr(err)

Where MustNotErr is +/- func(err) {err!=nil && panic(err)}


Have you yet considered *something* like this ?
logged, MustNotErr<- := view.Auth.IsLoggedIn()

Where MustNotErr would be invoked with the value of err, whatever it is nil 
or not, and deal with it.

A bit further, we could imagine,
logged, LogIt(namespace)<- := view.Auth.IsLoggedIn()

Where LogIt would be a func(args ...watever) func(err error) { ... }

Does it make any sense to you too ?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread tacodewolff
It is not up to the Go team to decide where the community chooses to spend 
their time. The arrogance in previous statements is staggering.

The CEO changed something on a totally unrelated subreddit. Sounds like that 
incident is used to clean house for Go (get rid of Reddit); a political move 
that is simply not up to the Go team. Users may choose to leave reddit over the 
incident (personally I don't care at all), but you cannot force your opinion 
onto the users.

Anyways, I bet the subreddit would be recreated quickly so that the current 
moderators achieve nothing in the end but lose their priviledges.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Hide struct fields from frontend code (JSON REST API)

2016-11-25 Thread Tamás Gulácsi
Yoz can create a MarshalJSON method on the struct (type), that filters out 
private fields, based on either field name, or a field tag.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Why doens't function type support comparision but channel type does?

2016-11-25 Thread atd...@gmail.com
It highly depends on what you define a function.

If it's in the mathematical sense, it won't work.

A function, in practice, is a small embedded program (stored as a valur in 
the main program). It's not just the text (semantics). It's defined 
somewhere (in some package etc...)

That's all those things that probably need to be equal.

On Friday, November 25, 2016 at 12:28:52 PM UTC+1, Jesper Louis Andersen 
wrote:
>
> Indeed, the whole point is that you shouldn't add equality of functions to 
> a language. I disagree that the formal proof of function equivalence is a 
> red herring. Rather, it is the crux of the problem: the only sensible 
> equality of functions turns out to be observational equality, which is 
> non-trivial to handle. But in order to understand that, you eventually have 
> to discuss what it would take to add such a thing to a language. Talk is 
> rather cheap compared to writing a robust compiler with deterministic 
> interfaces. In the same vein, I don't think float32 and float64 should be 
> eqtypes either. Nor, can it be argued, should a map or array because their 
> equivalence isn't an O(1) operation.
>
> On Fri, Nov 25, 2016 at 11:38 AM 'Axel Wagner' via golang-nuts <
> golan...@googlegroups.com > wrote:
>
>> I think, in the context of this thread, talking about formally proving 
>> whether two functions produces equivalent results is a red herring.
>>
>> a) It is an impossible problem to solve in general, so you'd need to 
>> restrict your definition to some provable subset
>> b) That will be impossible to put in a spec in any sensible way without 
>> blowing it up immensely
>> c) Even if, that subset can't include side-effects, which would make it 
>> completely useless for go
>> and d) even if you could, requiring to implement those proofs would make 
>> it highly unlikely if not impossible, that more than one (or a very small 
>> handful) go-implementation exists, defeating the point of a good spec in 
>> the first place (think about, for example, what that would mean for 
>> gopherjs or gomobile, where a func() can be implemented by opaque 
>> javascript/asm/dalvik bytecode/compiled machine code).
>>
>> If you want to debate the finer points of such proof engines for go 
>> existing as a tool separate from the language, I think that should go in a 
>> separate thread. I don't think it can be sensibly argued that it should 
>> become part of the language as the equality operator on func's.
>>
>> On Fri, Nov 25, 2016 at 11:05 AM, Jesper Louis Andersen <
>> jesper.lou...@gmail.com > wrote:
>>
>>>
>>> On Fri, Nov 25, 2016 at 12:30 AM Michael Jones >> > wrote:
>>>
 This is very nice! However, am i right in understanding that the magic 
 is in knowing the text of the program--the fact that there are untaken 
 branches? If so, this is not simply a 'behavioral' verification...it knows 
 about the construction of the code and not just its behavior. Maybe I was 
 unclear.
  

>>>
>>> Indeed you are right. This requires the ability to work on the program 
>>> text. It is a bit too hard to work on the output assembly for the program. 
>>> The advantage of a model-checker or a probalistic method such as 
>>> "testing/quick" is that they regard the system-under-test as a black box.
>>>
>>> This fact can be used in numerous ways. The most powerful one is that 
>>> once you have a specification model, in *any* programming language, it 
>>> applies to any system implementing that model, in *any* language. This has 
>>> been used historically for checking protocols for correctness, where the 
>>> specification were written in some high-level language (Haskell, Erlang) 
>>> but the code being tested were run in a low-level language (C, typically).
>>>
>>> In short, no single method applies in every case. Figuring out if two 
>>> programs are observationally equivalent usually requires one to exploit the 
>>> structure of the program text. Because from that structure the proof or 
>>> search strategy can be extracted.
>>>  
>>>
>> -- 
>>>
>> 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...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> 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...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Seth Ammons
As a /r/golang user, I remember being delighted to find out that actual core 
contributors came in and commented. I never never occurred to me that the 
subreddit would have been considered official.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] So how exactly one does(should do) forking/pull requests in Golang world

2016-11-25 Thread 'Axel Wagner' via golang-nuts
There is exactly one instance of "package local sub-packages" and that is
internal packages (okay. And arguably vendoring). For everything else, the
same logic applies. I don't find it too much to ask in that case, to
actually and explicitly fork.

On Fri, Nov 25, 2016 at 1:27 PM, Mariusz Gronczewski 
wrote:

> I'm fine with namespacing and I see benefits for it for deps, just it
> would be nice to have something inbetween absolute path and
> "../../something" (like "$ROOT/packagename") for package-local
> "subpackages" that are not designed to be standalone ones (like in my
> case it is usually a package holding few structs shared between other
> packages).
>
> > I also advocated elsewhere for go get having the ability to use some
> kind of mirror for fetching, to solve the "code can vanish" objection why
> people want vendoring (e.g. your company runs a mirror of all your used
> open source code and you use "go get --proxy=internal.company.net
> github.com/some/package" and go-get fetches it from "
> internal.company.net/github.com/some/package" or something like that).
>
> Yeah it would be nice. Maybe in the form of .dotfile with just a list
> of aliases for each part of the address, grouped into "profiles". That
> would allow to for example have a empty profile (or just one that maps
> your public code to github and leaves private for internal repos) for
> normal work and "github-down" profile that points it to internal
> mirror in case there is something wrong with
>
> 2016-11-25 13:00 GMT+01:00 Axel Wagner :
> > I think it's reasonable to expect you to set up your GOPATH accordingly,
> if
> > you want the layout to be internal and specific and deviating from the
> > discovery mechanism. There is no reason, why a tool couldn't fetch your
> > internal git-repository to the subpath of $GOPATH that corresponds to
> your
> > public mirror.
> > I also advocated elsewhere for go get having the ability to use some
> kind of
> > mirror for fetching, to solve the "code can vanish" objection why people
> > want vendoring (e.g. your company runs a mirror of all your used open
> source
> > code and you use "go get --proxy=internal.company.net
> > github.com/some/package" and go-get fetches it from
> > "internal.company.net/github.com/some/package" or something like that).
> >
> > In any case, I don't think that these things are outweighing the pros of
> > go's decentralized approach to namespacing and hosting; the disadvantages
> > have relatively obvious solutions.
> >
> >
> > On Fri, Nov 25, 2016 at 12:48 PM, Mariusz Gronczewski  >
> > wrote:
> >>
> >>
> >>
> >> On Friday, November 25, 2016 at 12:10:56 PM UTC+1, Axel Wagner wrote:
> >>>
> >>> It is pretty simple:
> >>>
> >>> * If you actually *fork* a project (not what github calls a "fork", but
> >>> "create a repo with a different set of maintainers"), *that is a
> different
> >>> package*. It will contain different code and have a different
> mantainer. So
> >>> it is a feature, that go get won't work on it OOTB. To make it work,
> you
> >>> have to commit making and using it as a different package by changing
> import
> >>> paths. People pretend like forking should take over another persons
> package,
> >>> but that just doesn't make sense, that's the whole point of identifying
> >>> packages by import paths and having a discovery mechanism that
> reconciles
> >>> conflicts by relying on the DNS.
> >>> * To prepare a PR, just add your "fork" (I hate githubs nomenclature
> >>> here) as a second remote in $GOPATH/src/github.com/upstream/project.
> Commit
> >>> and push to your fork, then create the PR. When done, optionally,
> delete
> >>> your fork.
> >>>
> >>> The two things are very different processes. One is "being dissatisfied
> >>> with a project so taking over maintainership" (what the FOSS-community
> calls
> >>> "forking") and the other is "publishing a copy of a repo with your
> patches
> >>> so that the maintainer can pull from it" (what github calls "forking",
> but
> >>> is actually just "using the decentralized nature of git as a VCS).
> Don't mix
> >>> the two up and everything makes sense.
> >>
> >>
> >> I get it but often I have a problem where "main" place of development is
> >> our internal repository (and for various political reasons github can't
> be
> >> used for that) but we'd still want to open source that code and not
> have to
> >> deal with path translation.
> >>
> >> There is also the "I want to show it to someone but they are
> >> git-illiterate" case
> >>
> >>
> >>>
> >>>
> >>>
> >>> On Fri, Nov 25, 2016 at 11:40 AM, Mariusz Gronczewski <
> xan...@gmail.com>
> >>> wrote:
> 
>  But then go get github.com/me/project will be non-functional ?
> 
>  2016-11-25 11:35 GMT+01:00 Ian Davis :
>  > This is how to do it with a git repository:
>  >
>  >
>  > http://blog.campoy.cat/2014/03/github-and-go-forking-pull-
> 

Re: [go-nuts] So how exactly one does(should do) forking/pull requests in Golang world

2016-11-25 Thread Mariusz Gronczewski
I'm fine with namespacing and I see benefits for it for deps, just it
would be nice to have something inbetween absolute path and
"../../something" (like "$ROOT/packagename") for package-local
"subpackages" that are not designed to be standalone ones (like in my
case it is usually a package holding few structs shared between other
packages).

> I also advocated elsewhere for go get having the ability to use some kind of 
> mirror for fetching, to solve the "code can vanish" objection why people want 
> vendoring (e.g. your company runs a mirror of all your used open source code 
> and you use "go get --proxy=internal.company.net github.com/some/package" and 
> go-get fetches it from "internal.company.net/github.com/some/package" or 
> something like that).

Yeah it would be nice. Maybe in the form of .dotfile with just a list
of aliases for each part of the address, grouped into "profiles". That
would allow to for example have a empty profile (or just one that maps
your public code to github and leaves private for internal repos) for
normal work and "github-down" profile that points it to internal
mirror in case there is something wrong with

2016-11-25 13:00 GMT+01:00 Axel Wagner :
> I think it's reasonable to expect you to set up your GOPATH accordingly, if
> you want the layout to be internal and specific and deviating from the
> discovery mechanism. There is no reason, why a tool couldn't fetch your
> internal git-repository to the subpath of $GOPATH that corresponds to your
> public mirror.
> I also advocated elsewhere for go get having the ability to use some kind of
> mirror for fetching, to solve the "code can vanish" objection why people
> want vendoring (e.g. your company runs a mirror of all your used open source
> code and you use "go get --proxy=internal.company.net
> github.com/some/package" and go-get fetches it from
> "internal.company.net/github.com/some/package" or something like that).
>
> In any case, I don't think that these things are outweighing the pros of
> go's decentralized approach to namespacing and hosting; the disadvantages
> have relatively obvious solutions.
>
>
> On Fri, Nov 25, 2016 at 12:48 PM, Mariusz Gronczewski 
> wrote:
>>
>>
>>
>> On Friday, November 25, 2016 at 12:10:56 PM UTC+1, Axel Wagner wrote:
>>>
>>> It is pretty simple:
>>>
>>> * If you actually *fork* a project (not what github calls a "fork", but
>>> "create a repo with a different set of maintainers"), *that is a different
>>> package*. It will contain different code and have a different mantainer. So
>>> it is a feature, that go get won't work on it OOTB. To make it work, you
>>> have to commit making and using it as a different package by changing import
>>> paths. People pretend like forking should take over another persons package,
>>> but that just doesn't make sense, that's the whole point of identifying
>>> packages by import paths and having a discovery mechanism that reconciles
>>> conflicts by relying on the DNS.
>>> * To prepare a PR, just add your "fork" (I hate githubs nomenclature
>>> here) as a second remote in $GOPATH/src/github.com/upstream/project. Commit
>>> and push to your fork, then create the PR. When done, optionally, delete
>>> your fork.
>>>
>>> The two things are very different processes. One is "being dissatisfied
>>> with a project so taking over maintainership" (what the FOSS-community calls
>>> "forking") and the other is "publishing a copy of a repo with your patches
>>> so that the maintainer can pull from it" (what github calls "forking", but
>>> is actually just "using the decentralized nature of git as a VCS). Don't mix
>>> the two up and everything makes sense.
>>
>>
>> I get it but often I have a problem where "main" place of development is
>> our internal repository (and for various political reasons github can't be
>> used for that) but we'd still want to open source that code and not have to
>> deal with path translation.
>>
>> There is also the "I want to show it to someone but they are
>> git-illiterate" case
>>
>>
>>>
>>>
>>>
>>> On Fri, Nov 25, 2016 at 11:40 AM, Mariusz Gronczewski 
>>> wrote:

 But then go get github.com/me/project will be non-functional ?

 2016-11-25 11:35 GMT+01:00 Ian Davis :
 > This is how to do it with a git repository:
 >
 >
 > http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html
 >
 >
 > On Fri, Nov 25, 2016, at 10:31 AM, Mariusz Gronczewski wrote:
 >
 > Hi,
 >
 > So let's say there is a project, living under path
 > github.com/local/project.
 > Project is neatly divided into a bunch of packages and uses
 > recommended
 > absolute paths:
 >
 > package main
 >
 > import (
 > "github.com/external/dep1"
 > "github.com/local/project/config"
 > "github.com/local/project/backend"
 > "github.com/local/project/frontend"
 > )

Re: [go-nuts] So how exactly one does(should do) forking/pull requests in Golang world

2016-11-25 Thread 'Axel Wagner' via golang-nuts
I think it's reasonable to expect you to set up your GOPATH accordingly, if
you want the layout to be internal and specific and deviating from the
discovery mechanism. There is no reason, why a tool couldn't fetch your
internal git-repository to the subpath of $GOPATH that corresponds to your
public mirror.
I also advocated elsewhere for go get having the ability to use some kind
of mirror for fetching, to solve the "code can vanish" objection why people
want vendoring (e.g. your company runs a mirror of all your used open
source code and you use "go get --proxy=internal.company.net
github.com/some/package" and go-get fetches it from "
internal.company.net/github.com/some/package" or something like that).

In any case, I don't think that these things are outweighing the pros of
go's decentralized approach to namespacing and hosting; the disadvantages
have relatively obvious solutions.


On Fri, Nov 25, 2016 at 12:48 PM, Mariusz Gronczewski 
wrote:

>
>
> On Friday, November 25, 2016 at 12:10:56 PM UTC+1, Axel Wagner wrote:
>>
>> It is pretty simple:
>>
>> * If you actually *fork* a project (not what github calls a "fork", but
>> "create a repo with a different set of maintainers"), *that is a different
>> package*. It will contain different code and have a different mantainer. So
>> it is a feature, that go get won't work on it OOTB. To make it work, you
>> have to commit making and using it as a different package by changing
>> import paths. People pretend like forking should take over another persons
>> package, but that just doesn't make sense, that's the whole point of
>> identifying packages by import paths and having a discovery mechanism that
>> reconciles conflicts by relying on the DNS.
>> * To prepare a PR, just add your "fork" (I hate githubs nomenclature
>> here) as a second remote in $GOPATH/src/github.com/upstream/project.
>> Commit and push to your fork, then create the PR. When done, optionally,
>> delete your fork.
>>
>> The two things are very different processes. One is "being dissatisfied
>> with a project so taking over maintainership" (what the FOSS-community
>> calls "forking") and the other is "publishing a copy of a repo with your
>> patches so that the maintainer can pull from it" (what github calls
>> "forking", but is actually just "using the decentralized nature of git as a
>> VCS). Don't mix the two up and everything makes sense.
>>
>
> I get it but often I have a problem where "main" place of development is
> our internal repository (and for various political reasons github can't be
> used for that) but we'd still want to open source that code and not have to
> deal with path translation.
>
> There is also the "I want to show it to someone but they are
> git-illiterate" case
>
>
>
>>
>>
>> On Fri, Nov 25, 2016 at 11:40 AM, Mariusz Gronczewski 
>> wrote:
>>
>>> But then go get github.com/me/project will be non-functional ?
>>>
>>> 2016-11-25 11:35 GMT+01:00 Ian Davis :
>>> > This is how to do it with a git repository:
>>> >
>>> > http://blog.campoy.cat/2014/03/github-and-go-forking-pull-re
>>> quests-and.html
>>> >
>>> >
>>> > On Fri, Nov 25, 2016, at 10:31 AM, Mariusz Gronczewski wrote:
>>> >
>>> > Hi,
>>> >
>>> > So let's say there is a project, living under path
>>> github.com/local/project.
>>> > Project is neatly divided into a bunch of packages and uses recommended
>>> > absolute paths:
>>> >
>>> > package main
>>> >
>>> > import (
>>> > "github.com/external/dep1"
>>> > "github.com/local/project/config"
>>> > "github.com/local/project/backend"
>>> > "github.com/local/project/frontend"
>>> > )
>>> >
>>> >
>>> > and packages inside of it also use that:
>>> >
>>> > package backend
>>> >
>>> > import (
>>> > "github.com/external/dep3"
>>> > "github.com/external/dep4"
>>> > "github.com/local/project/config"
>>> > "github.com/local/project/backend/nosql"
>>> > "github.com/local/project/backend/sql"
>>> > "github.com/local/project/backend/dummy"
>>> > )
>>> >
>>> > package frontend
>>> >
>>> > import (
>>> > "github.com/external/dep5"
>>> > "github.com/external/dep6"
>>> > "github.com/local/project/config"
>>> > "github.com/local/project/backend"
>>> > "github.com/local/project/frontend/html"
>>> > "github.com/local/project/frontend/pdf"
>>> > )
>>> >
>>> > ...how does one contribute to it ?
>>> >
>>> > If I just go and fork it and do a bunch of changes across packages
>>> then I
>>> > can't test it because everything will be under "github.com/me/project"
>>> so
>>> > deps will come from the "wrong" place.
>>> >
>>> > If I go and find-replace everything now I can work in peace but any
>>> diff or
>>> > pull request from it wont make any sense as now it will contain wrong
>>> paths
>>> >
>>> > If I use relative packages then things like `go test` complain about
>>> local
>>> > imports and wont run.
>>> >
>>> > Surely there is a better method than "just glue it with some symlinks"
>>> ?
>>> >
>>> > Cheers, Mariusz
>>> >
>>> 

Re: [go-nuts] So how exactly one does(should do) forking/pull requests in Golang world

2016-11-25 Thread Mariusz Gronczewski


On Friday, November 25, 2016 at 12:10:56 PM UTC+1, Axel Wagner wrote:
>
> It is pretty simple:
>
> * If you actually *fork* a project (not what github calls a "fork", but 
> "create a repo with a different set of maintainers"), *that is a different 
> package*. It will contain different code and have a different mantainer. So 
> it is a feature, that go get won't work on it OOTB. To make it work, you 
> have to commit making and using it as a different package by changing 
> import paths. People pretend like forking should take over another persons 
> package, but that just doesn't make sense, that's the whole point of 
> identifying packages by import paths and having a discovery mechanism that 
> reconciles conflicts by relying on the DNS.
> * To prepare a PR, just add your "fork" (I hate githubs nomenclature here) 
> as a second remote in $GOPATH/src/github.com/upstream/project. Commit and 
> push to your fork, then create the PR. When done, optionally, delete your 
> fork.
>
> The two things are very different processes. One is "being dissatisfied 
> with a project so taking over maintainership" (what the FOSS-community 
> calls "forking") and the other is "publishing a copy of a repo with your 
> patches so that the maintainer can pull from it" (what github calls 
> "forking", but is actually just "using the decentralized nature of git as a 
> VCS). Don't mix the two up and everything makes sense.
>

I get it but often I have a problem where "main" place of development is 
our internal repository (and for various political reasons github can't be 
used for that) but we'd still want to open source that code and not have to 
deal with path translation.

There is also the "I want to show it to someone but they are 
git-illiterate" case

 

>
>
> On Fri, Nov 25, 2016 at 11:40 AM, Mariusz Gronczewski  > wrote:
>
>> But then go get github.com/me/project will be non-functional ?
>>
>> 2016-11-25 11:35 GMT+01:00 Ian Davis :
>> > This is how to do it with a git repository:
>> >
>> > 
>> http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html
>> >
>> >
>> > On Fri, Nov 25, 2016, at 10:31 AM, Mariusz Gronczewski wrote:
>> >
>> > Hi,
>> >
>> > So let's say there is a project, living under path 
>> github.com/local/project.
>> > Project is neatly divided into a bunch of packages and uses recommended
>> > absolute paths:
>> >
>> > package main
>> >
>> > import (
>> > "github.com/external/dep1"
>> > "github.com/local/project/config"
>> > "github.com/local/project/backend"
>> > "github.com/local/project/frontend"
>> > )
>> >
>> >
>> > and packages inside of it also use that:
>> >
>> > package backend
>> >
>> > import (
>> > "github.com/external/dep3"
>> > "github.com/external/dep4"
>> > "github.com/local/project/config"
>> > "github.com/local/project/backend/nosql"
>> > "github.com/local/project/backend/sql"
>> > "github.com/local/project/backend/dummy"
>> > )
>> >
>> > package frontend
>> >
>> > import (
>> > "github.com/external/dep5"
>> > "github.com/external/dep6"
>> > "github.com/local/project/config"
>> > "github.com/local/project/backend"
>> > "github.com/local/project/frontend/html"
>> > "github.com/local/project/frontend/pdf"
>> > )
>> >
>> > ...how does one contribute to it ?
>> >
>> > If I just go and fork it and do a bunch of changes across packages then 
>> I
>> > can't test it because everything will be under "github.com/me/project" 
>> so
>> > deps will come from the "wrong" place.
>> >
>> > If I go and find-replace everything now I can work in peace but any 
>> diff or
>> > pull request from it wont make any sense as now it will contain wrong 
>> paths
>> >
>> > If I use relative packages then things like `go test` complain about 
>> local
>> > imports and wont run.
>> >
>> > Surely there is a better method than "just glue it with some symlinks" ?
>> >
>> > Cheers, Mariusz
>> >
>> >
>> > --
>> > 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...@googlegroups.com .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> > --
>> > You received this message because you are subscribed to a topic in the
>> > Google Groups "golang-nuts" group.
>> > To unsubscribe from this topic, visit
>> > https://groups.google.com/d/topic/golang-nuts/if5H8kRAT30/unsubscribe.
>> > To unsubscribe from this group and all its topics, send an email to
>> > golang-nuts...@googlegroups.com .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Mariusz Gronczewski (XANi) 
>> GnuPG: 0xEA8ACE64
>>
>> --
>> 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...@googlegroups.com .
>> For more 

[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Adnaan Badr
Please don't ! It's a neat resource to discover new projects. And one of 
the forums I send newbies to, so that they could get a feel for real world 
Go projects and questions. I am sure people will volunteer to moderate if 
the current moderators don't want to. 

On Friday, 25 November 2016 05:23:32 UTC+5:30, bradfitz wrote:
>
> In light of the CEO of Reddit admitting to editing user comments (see 
> dozen news stories today), I propose we delete the /r/golang subreddit.
>
> That is so beyond unethical and immature, I no longer want anything to do 
> with that site. I will be deleting my account on Reddit after backing up my 
> content, and I will no longer be a moderator of /r/golang.
>
> If other moderators of /r/golang feel strongly that it should remain, I 
> suppose you're welcome to keep it going.
>
> But if the other moderators want to abandon it and focus our conversation 
> elsewhere (or build a replacement), I'm happy to just delete /r/golang.
>
> Opinions?
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Why doens't function type support comparision but channel type does?

2016-11-25 Thread Jesper Louis Andersen
Indeed, the whole point is that you shouldn't add equality of functions to
a language. I disagree that the formal proof of function equivalence is a
red herring. Rather, it is the crux of the problem: the only sensible
equality of functions turns out to be observational equality, which is
non-trivial to handle. But in order to understand that, you eventually have
to discuss what it would take to add such a thing to a language. Talk is
rather cheap compared to writing a robust compiler with deterministic
interfaces. In the same vein, I don't think float32 and float64 should be
eqtypes either. Nor, can it be argued, should a map or array because their
equivalence isn't an O(1) operation.

On Fri, Nov 25, 2016 at 11:38 AM 'Axel Wagner' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> I think, in the context of this thread, talking about formally proving
> whether two functions produces equivalent results is a red herring.
>
> a) It is an impossible problem to solve in general, so you'd need to
> restrict your definition to some provable subset
> b) That will be impossible to put in a spec in any sensible way without
> blowing it up immensely
> c) Even if, that subset can't include side-effects, which would make it
> completely useless for go
> and d) even if you could, requiring to implement those proofs would make
> it highly unlikely if not impossible, that more than one (or a very small
> handful) go-implementation exists, defeating the point of a good spec in
> the first place (think about, for example, what that would mean for
> gopherjs or gomobile, where a func() can be implemented by opaque
> javascript/asm/dalvik bytecode/compiled machine code).
>
> If you want to debate the finer points of such proof engines for go
> existing as a tool separate from the language, I think that should go in a
> separate thread. I don't think it can be sensibly argued that it should
> become part of the language as the equality operator on func's.
>
> On Fri, Nov 25, 2016 at 11:05 AM, Jesper Louis Andersen <
> jesper.louis.ander...@gmail.com> wrote:
>
>
> On Fri, Nov 25, 2016 at 12:30 AM Michael Jones 
> wrote:
>
> This is very nice! However, am i right in understanding that the magic is
> in knowing the text of the program--the fact that there are untaken
> branches? If so, this is not simply a 'behavioral' verification...it knows
> about the construction of the code and not just its behavior. Maybe I was
> unclear.
>
>
>
> Indeed you are right. This requires the ability to work on the program
> text. It is a bit too hard to work on the output assembly for the program.
> The advantage of a model-checker or a probalistic method such as
> "testing/quick" is that they regard the system-under-test as a black box.
>
> This fact can be used in numerous ways. The most powerful one is that once
> you have a specification model, in *any* programming language, it applies
> to any system implementing that model, in *any* language. This has been
> used historically for checking protocols for correctness, where the
> specification were written in some high-level language (Haskell, Erlang)
> but the code being tested were run in a low-level language (C, typically).
>
> In short, no single method applies in every case. Figuring out if two
> programs are observationally equivalent usually requires one to exploit the
> structure of the program text. Because from that structure the proof or
> search strategy can be extracted.
>
>
> --
>
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread Harrison Kelly
Individually, I get all my Go news (including this) through /r/golang so please 
don't. 

Strategically, I think deleting it does more harm than good.

I get that sometimes principles should trump practicality, but this specific 
problem seems very minor. By keeping it open, we aren't confining the CEO's 
actions. But we are [re]inviting 25,000+ people to participate in the Go 
community, which is a heck of a limb to cut off on principle. 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] So how exactly one does(should do) forking/pull requests in Golang world

2016-11-25 Thread 'Axel Wagner' via golang-nuts
It is pretty simple:

* If you actually *fork* a project (not what github calls a "fork", but
"create a repo with a different set of maintainers"), *that is a different
package*. It will contain different code and have a different mantainer. So
it is a feature, that go get won't work on it OOTB. To make it work, you
have to commit making and using it as a different package by changing
import paths. People pretend like forking should take over another persons
package, but that just doesn't make sense, that's the whole point of
identifying packages by import paths and having a discovery mechanism that
reconciles conflicts by relying on the DNS.
* To prepare a PR, just add your "fork" (I hate githubs nomenclature here)
as a second remote in $GOPATH/src/github.com/upstream/project. Commit and
push to your fork, then create the PR. When done, optionally, delete your
fork.

The two things are very different processes. One is "being dissatisfied
with a project so taking over maintainership" (what the FOSS-community
calls "forking") and the other is "publishing a copy of a repo with your
patches so that the maintainer can pull from it" (what github calls
"forking", but is actually just "using the decentralized nature of git as a
VCS). Don't mix the two up and everything makes sense.


On Fri, Nov 25, 2016 at 11:40 AM, Mariusz Gronczewski 
wrote:

> But then go get github.com/me/project will be non-functional ?
>
> 2016-11-25 11:35 GMT+01:00 Ian Davis :
> > This is how to do it with a git repository:
> >
> > http://blog.campoy.cat/2014/03/github-and-go-forking-pull-
> requests-and.html
> >
> >
> > On Fri, Nov 25, 2016, at 10:31 AM, Mariusz Gronczewski wrote:
> >
> > Hi,
> >
> > So let's say there is a project, living under path
> github.com/local/project.
> > Project is neatly divided into a bunch of packages and uses recommended
> > absolute paths:
> >
> > package main
> >
> > import (
> > "github.com/external/dep1"
> > "github.com/local/project/config"
> > "github.com/local/project/backend"
> > "github.com/local/project/frontend"
> > )
> >
> >
> > and packages inside of it also use that:
> >
> > package backend
> >
> > import (
> > "github.com/external/dep3"
> > "github.com/external/dep4"
> > "github.com/local/project/config"
> > "github.com/local/project/backend/nosql"
> > "github.com/local/project/backend/sql"
> > "github.com/local/project/backend/dummy"
> > )
> >
> > package frontend
> >
> > import (
> > "github.com/external/dep5"
> > "github.com/external/dep6"
> > "github.com/local/project/config"
> > "github.com/local/project/backend"
> > "github.com/local/project/frontend/html"
> > "github.com/local/project/frontend/pdf"
> > )
> >
> > ...how does one contribute to it ?
> >
> > If I just go and fork it and do a bunch of changes across packages then I
> > can't test it because everything will be under "github.com/me/project"
> so
> > deps will come from the "wrong" place.
> >
> > If I go and find-replace everything now I can work in peace but any diff
> or
> > pull request from it wont make any sense as now it will contain wrong
> paths
> >
> > If I use relative packages then things like `go test` complain about
> local
> > imports and wont run.
> >
> > Surely there is a better method than "just glue it with some symlinks" ?
> >
> > Cheers, Mariusz
> >
> >
> > --
> > 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+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the
> > Google Groups "golang-nuts" group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/topic/golang-nuts/if5H8kRAT30/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> > golang-nuts+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Mariusz Gronczewski (XANi) 
> GnuPG: 0xEA8ACE64
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] So how exactly one does(should do) forking/pull requests in Golang world

2016-11-25 Thread Mariusz Gronczewski
But then go get github.com/me/project will be non-functional ?

2016-11-25 11:35 GMT+01:00 Ian Davis :
> This is how to do it with a git repository:
>
> http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html
>
>
> On Fri, Nov 25, 2016, at 10:31 AM, Mariusz Gronczewski wrote:
>
> Hi,
>
> So let's say there is a project, living under path github.com/local/project.
> Project is neatly divided into a bunch of packages and uses recommended
> absolute paths:
>
> package main
>
> import (
> "github.com/external/dep1"
> "github.com/local/project/config"
> "github.com/local/project/backend"
> "github.com/local/project/frontend"
> )
>
>
> and packages inside of it also use that:
>
> package backend
>
> import (
> "github.com/external/dep3"
> "github.com/external/dep4"
> "github.com/local/project/config"
> "github.com/local/project/backend/nosql"
> "github.com/local/project/backend/sql"
> "github.com/local/project/backend/dummy"
> )
>
> package frontend
>
> import (
> "github.com/external/dep5"
> "github.com/external/dep6"
> "github.com/local/project/config"
> "github.com/local/project/backend"
> "github.com/local/project/frontend/html"
> "github.com/local/project/frontend/pdf"
> )
>
> ...how does one contribute to it ?
>
> If I just go and fork it and do a bunch of changes across packages then I
> can't test it because everything will be under "github.com/me/project" so
> deps will come from the "wrong" place.
>
> If I go and find-replace everything now I can work in peace but any diff or
> pull request from it wont make any sense as now it will contain wrong paths
>
> If I use relative packages then things like `go test` complain about local
> imports and wont run.
>
> Surely there is a better method than "just glue it with some symlinks" ?
>
> Cheers, Mariusz
>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/if5H8kRAT30/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Mariusz Gronczewski (XANi) 
GnuPG: 0xEA8ACE64

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Why doens't function type support comparision but channel type does?

2016-11-25 Thread 'Axel Wagner' via golang-nuts
I think, in the context of this thread, talking about formally proving
whether two functions produces equivalent results is a red herring.

a) It is an impossible problem to solve in general, so you'd need to
restrict your definition to some provable subset
b) That will be impossible to put in a spec in any sensible way without
blowing it up immensely
c) Even if, that subset can't include side-effects, which would make it
completely useless for go
and d) even if you could, requiring to implement those proofs would make it
highly unlikely if not impossible, that more than one (or a very small
handful) go-implementation exists, defeating the point of a good spec in
the first place (think about, for example, what that would mean for
gopherjs or gomobile, where a func() can be implemented by opaque
javascript/asm/dalvik bytecode/compiled machine code).

If you want to debate the finer points of such proof engines for go
existing as a tool separate from the language, I think that should go in a
separate thread. I don't think it can be sensibly argued that it should
become part of the language as the equality operator on func's.

On Fri, Nov 25, 2016 at 11:05 AM, Jesper Louis Andersen <
jesper.louis.ander...@gmail.com> wrote:

>
> On Fri, Nov 25, 2016 at 12:30 AM Michael Jones 
> wrote:
>
>> This is very nice! However, am i right in understanding that the magic is
>> in knowing the text of the program--the fact that there are untaken
>> branches? If so, this is not simply a 'behavioral' verification...it knows
>> about the construction of the code and not just its behavior. Maybe I was
>> unclear.
>>
>>
>
> Indeed you are right. This requires the ability to work on the program
> text. It is a bit too hard to work on the output assembly for the program.
> The advantage of a model-checker or a probalistic method such as
> "testing/quick" is that they regard the system-under-test as a black box.
>
> This fact can be used in numerous ways. The most powerful one is that once
> you have a specification model, in *any* programming language, it applies
> to any system implementing that model, in *any* language. This has been
> used historically for checking protocols for correctness, where the
> specification were written in some high-level language (Haskell, Erlang)
> but the code being tested were run in a low-level language (C, typically).
>
> In short, no single method applies in every case. Figuring out if two
> programs are observationally equivalent usually requires one to exploit the
> structure of the program text. Because from that structure the proof or
> search strategy can be extracted.
>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] So how exactly one does(should do) forking/pull requests in Golang world

2016-11-25 Thread Jan Mercl
On Fri, Nov 25, 2016 at 11:31 AM Mariusz Gronczewski 
wrote:

> If I just go and fork it and do a bunch of changes across packages then I
can't test it because everything will be under "github.com/me/project" so
deps will come from the "wrong" place.

1. Fork it on githug.
2. $ mkdir -p $GOPATH/src/github.com/local/project
3. $ cd $GOPATH/src/github.com/local
4. $ git clone https://github.com/me/project


-- 

-j

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] So how exactly one does(should do) forking/pull requests in Golang world

2016-11-25 Thread Sebastien Binet
On Fri, Nov 25, 2016 at 11:31 AM, Mariusz Gronczewski 
wrote:

> Hi,
>
> So let's say there is a project, living under path
> github.com/local/project. Project is neatly divided into a bunch of
> packages and uses recommended absolute paths:
>
> package main
>
> import (
> "github.com/external/dep1"
> "github.com/local/project/config"
> "github.com/local/project/backend"
> "github.com/local/project/frontend"
> )
>
>
> and packages inside of it also use that:
>
> package backend
>
> import (
> "github.com/external/dep3"
> "github.com/external/dep4"
> "github.com/local/project/config"
> "github.com/local/project/backend/nosql"
> "github.com/local/project/backend/sql"
> "github.com/local/project/backend/dummy"
> )
>
> package frontend
>
> import (
> "github.com/external/dep5"
> "github.com/external/dep6"
> "github.com/local/project/config"
> "github.com/local/project/backend"
> "github.com/local/project/frontend/html"
> "github.com/local/project/frontend/pdf"
> )
>
> ...how does one contribute to it ?
>
> If I just go and fork it and do a bunch of changes across packages then I
> can't test it because everything will be under "github.com/me/project" so
> deps will come from the "wrong" place.
>
> If I go and find-replace everything now I can work in peace but any diff
> or pull request from it wont make any sense as now it will contain wrong
> paths
>
> If I use relative packages then things like `go test` complain about local
> imports and wont run.
>
> Surely there is a better method than "just glue it with some symlinks" ?
>

you fork it.
then, in your $GOPATH:

cd $GOPATH/src/github.com/local/project
git remote add me g...@github.com:me/project
git checkout -b new-pr
$EDITOR something.go
go get ./...
go test ./...
git commit -m "project: something got changed"
git push me new-pr

and voila.

hth,
-s

>
> Cheers, Mariusz
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] So how exactly one does(should do) forking/pull requests in Golang world

2016-11-25 Thread Ian Davis
This is how to do it with a git repository:



http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html




On Fri, Nov 25, 2016, at 10:31 AM, Mariusz Gronczewski wrote:

> Hi,

> 

> So let's say there is a project, living under path
> github.com/local/project. Project is neatly divided into a bunch of
> packages and uses recommended absolute paths:
> 

> package main

> 

> import (

> "github.com/external/dep1"

> "github.com/local/project/config"

> "github.com/local/project/backend"

> "github.com/local/project/frontend"

> )

> 

> 

> and packages inside of it also use that:

> 

> package backend

> 

> import (

> "github.com/external/dep3"

> "github.com/external/dep4"

> "github.com/local/project/config"

> "github.com/local/project/backend/nosql"

> "github.com/local/project/backend/sql"

> "github.com/local/project/backend/dummy"

> )

> 

> package frontend

> 

> import (

> "github.com/external/dep5"

> "github.com/external/dep6"

> "github.com/local/project/config"

> "github.com/local/project/backend"

> "github.com/local/project/frontend/html"

> "github.com/local/project/frontend/pdf"

> )

> 

> ...how does one contribute to it ?

> 

> If I just go and fork it and do a bunch of changes across packages
> then I can't test it because everything will be under
> "github.com/me/project" so deps will come from the "wrong" place.
> 

> If I go and find-replace everything now I can work in peace but any
> diff or pull request from it wont make any sense as now it will
> contain wrong paths
> 

> If I use relative packages then things like `go test` complain about
> local imports and wont run.
> 

> Surely there is a better method than "just glue it with some
> symlinks" ?
> 

> Cheers, Mariusz

> 

> 



> --

>  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+unsubscr...@googlegroups.com.
>  For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] So how exactly one does(should do) forking/pull requests in Golang world

2016-11-25 Thread Mariusz Gronczewski
Hi,

So let's say there is a project, living under path 
github.com/local/project. Project is neatly divided into a bunch of 
packages and uses recommended absolute paths:

package main

import (
"github.com/external/dep1"
"github.com/local/project/config"
"github.com/local/project/backend"
"github.com/local/project/frontend"
)


and packages inside of it also use that:

package backend

import (
"github.com/external/dep3"
"github.com/external/dep4"
"github.com/local/project/config"
"github.com/local/project/backend/nosql"
"github.com/local/project/backend/sql"
"github.com/local/project/backend/dummy"
)

package frontend

import (
"github.com/external/dep5"
"github.com/external/dep6"
"github.com/local/project/config"
"github.com/local/project/backend"
"github.com/local/project/frontend/html"
"github.com/local/project/frontend/pdf"
)

...how does one contribute to it ?

If I just go and fork it and do a bunch of changes across packages then I 
can't test it because everything will be under "github.com/me/project" so 
deps will come from the "wrong" place.

If I go and find-replace everything now I can work in peace but any diff or 
pull request from it wont make any sense as now it will contain wrong paths

If I use relative packages then things like `go test` complain about local 
imports and wont run.

Surely there is a better method than "just glue it with some symlinks" ?

Cheers, Mariusz

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread prades . marq
+1 , delete it. Or let some other group take care of it and remove any 
official connection / link to golang.org . That farce lasted long enough. 
Let's concentrate on promoting Go the right way, not on a forum full of 
toxicity and shoddy admins. Stackoverflow is a better way to ask focused 
question ,and goggle-groups is enough for serious discussions. I'd like to 
see more Go activity on Google + too .

Le vendredi 25 novembre 2016 00:53:32 UTC+1, bradfitz a écrit :
>
> In light of the CEO of Reddit admitting to editing user comments (see 
> dozen news stories today), I propose we delete the /r/golang subreddit.
>
> That is so beyond unethical and immature, I no longer want anything to do 
> with that site. I will be deleting my account on Reddit after backing up my 
> content, and I will no longer be a moderator of /r/golang.
>
> If other moderators of /r/golang feel strongly that it should remain, I 
> suppose you're welcome to keep it going.
>
> But if the other moderators want to abandon it and focus our conversation 
> elsewhere (or build a replacement), I'm happy to just delete /r/golang.
>
> Opinions?
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Why doens't function type support comparision but channel type does?

2016-11-25 Thread Jesper Louis Andersen
On Fri, Nov 25, 2016 at 12:30 AM Michael Jones 
wrote:

> This is very nice! However, am i right in understanding that the magic is
> in knowing the text of the program--the fact that there are untaken
> branches? If so, this is not simply a 'behavioral' verification...it knows
> about the construction of the code and not just its behavior. Maybe I was
> unclear.
>
>

Indeed you are right. This requires the ability to work on the program
text. It is a bit too hard to work on the output assembly for the program.
The advantage of a model-checker or a probalistic method such as
"testing/quick" is that they regard the system-under-test as a black box.

This fact can be used in numerous ways. The most powerful one is that once
you have a specification model, in *any* programming language, it applies
to any system implementing that model, in *any* language. This has been
used historically for checking protocols for correctness, where the
specification were written in some high-level language (Haskell, Erlang)
but the code being tested were run in a low-level language (C, typically).

In short, no single method applies in every case. Figuring out if two
programs are observationally equivalent usually requires one to exploit the
structure of the program text. Because from that structure the proof or
search strategy can be extracted.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Aram Hăvărneanu
The disconnect between what the Go team acting as moderators think
about themselves, and what the reddit thinks about the moderator is
disconcerting, and it proves that these people are the wrong people
for the job.

Because some guy (not associated with either Go or /r/golang) abused
his power, their solution is to abuse **their** moderator powers to
nuke /r/golang from orbit (shit, who cares about the 25k+ people
there, let's not even inform them). Wow.

A moderator is a servant to a community and answers to it. He is not
the *owner* of a community. His job is to remove spam and ban
spammers, not to delete reddits.

You are not the owners of /r/golang. The people there are. You are
some guys hired to do a job. If you don't want it anymore, no problem,
I'm sure there are plenty of candidate replacements. If you don't like
/r/golang, no problem, there's a community for every type of
individual. It does not mean you have the right to delete it.

-- 
Aram Hăvărneanu

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread wilk
On 25-11-2016, Konstantin Khomoutov wrote:
> On Thu, 24 Nov 2016 23:59:18 -0800 (PST)
> Ainar Garipov  wrote:
>
>> Please no. Google Groups is awful, Reddit's /r/golang is where I get
>> most of my Go news. I don't want to sift through a forum with no
>> voting system, and awful and slow overly-JS-ed design.
>
> On a side note I continue to wonder why people struggle with crappy web
> stuff when they can just subscribe to this mailing list and get mail
> from it into their mailbox, and read/write mails there using convenient
> mail reader (with proper threads, searching tagging custom mail folders
> and so on).
>
> Google Groups is just a web front-end for those dirt-old but trusty
> mailing lists of the 90's ;-)
>

Right, Reddit is also a black hole of productivity !

It could be fine to have a comp.lang.go.announce like in python, open to 
external gophers.


-- 
William

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Using the new plugin API to create a Go REPL

2016-11-25 Thread Seb Binet
On Fri, Nov 25, 2016 at 9:41 AM, Jason Stillwell 
wrote:

> https://github.com/dragonfax/go_repl_plugin_example
>
> Its just a toy, but I thought it was an interesting idea.
>
> You compile a plugin with the code the user typed, and then load that into
> the process and execute it.
>

Nice!

I believe though that the "plugin" package can't really be the central tool
to build a REPL.
having a new plugin being built for each new command entered, won't scale
very far :)

it could be used as a nice stop gap solution for a JIT, though.

Feel free to reach out to the go-interpreter community:
 https://github.com/go-interpreter
 https://gophers.slack.com/messages/go-interpreter

-s

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Markus Zimmermann
Isn't this like saying a whole country is bad because of its 
president/leader? A whole community cannot be bad because of what one 
person did, nor can a whole company because of its CEO. golang-nuts/-dev 
would not be closed if one Google person behaves bad. We are a community of 
our own, we are the Go community as stated in https://golang.org/conduct 
and the CEO of Reddit is afaik not part of that community.

I am not a Reddit user, but I vote for making /r/golang unofficial, I do 
not know what that entails, and maybe transferring moderator rights to 
other people.

On Friday, November 25, 2016 at 12:53:32 AM UTC+1, bradfitz wrote:
>
> In light of the CEO of Reddit admitting to editing user comments (see 
> dozen news stories today), I propose we delete the /r/golang subreddit.
>
> That is so beyond unethical and immature, I no longer want anything to do 
> with that site. I will be deleting my account on Reddit after backing up my 
> content, and I will no longer be a moderator of /r/golang.
>
> If other moderators of /r/golang feel strongly that it should remain, I 
> suppose you're welcome to keep it going.
>
> But if the other moderators want to abandon it and focus our conversation 
> elsewhere (or build a replacement), I'm happy to just delete /r/golang.
>
> Opinions?
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread 'Axel Wagner' via golang-nuts
So 2¢:

a) I dislike reddit, it has a pretty bad culture of voting by opinion,
drowning out opinions seen as different from the mob and it just, in
general, has too many assholes (not /r/golang specifically, but reddit in
general).
b) I think one good argument for /r/golang over other things (like the go
forum or whatever) is the cross-pollination. It allows non- or part-time
gophers to voice their opinions and be heard in the go community and it
allows full-time gophers that hang around on reddit (largely due to
/r/golang) to also go to other subreddits and bring the go-perspective
there. I think that is good, when /r/programming once again decides that go
is the devil incarnated because it doesn't have ADT.
c) I would find it sad, if /r/golang (or /r/whatevsgolang) wouldn't be
official anymore, because that also means that the go CoC doesn't apply
anymore or at least wouldn't be enforceable for lack of a good escalation
path. As people pointed out, it is already kind of hard to moderate and
keep in check, I believe this would make it worse.
d) What /u/prez did was unconscionable and it makes it *very hard* to
defend the continuing existence of reddit as a whole; before it could at
least *pretend* to be a tool of free speech as a fig-leaf for allowing the
spread of all the hate. But this argument falters completely in the face of
censoring dissenting users content without consent.

FWIW, if /r/golang closes, I'll likely not frequent reddit anymore and will
eventually delete my account; I have /r/golang in my RSS-reader and if it
doesn't draw me there, I'll just forget over time. That's not an argument,
but it illustrates (b) somewhat.

On Fri, Nov 25, 2016 at 9:30 AM, Bogdan Bursuc 
wrote:

> +
>
> On Fri, Nov 25, 2016 at 10:20 AM Konstantin Khomoutov <
> flatw...@users.sourceforge.net> wrote:
>
>> On Thu, 24 Nov 2016 23:59:18 -0800 (PST)
>> Ainar Garipov  wrote:
>>
>> > Please no. Google Groups is awful, Reddit's /r/golang is where I get
>> > most of my Go news. I don't want to sift through a forum with no
>> > voting system, and awful and slow overly-JS-ed design.
>>
>> On a side note I continue to wonder why people struggle with crappy web
>> stuff when they can just subscribe to this mailing list and get mail
>> from it into their mailbox, and read/write mails there using convenient
>> mail reader (with proper threads, searching tagging custom mail folders
>> and so on).
>>
>> Google Groups is just a web front-end for those dirt-old but trusty
>> mailing lists of the 90's ;-)
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> Thanks,
> Bogdan I. Bursuc
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: time sub negative

2016-11-25 Thread Xu Lei


sTime := time.Now()


defer func() {


eTime := time.Now()


debug("Success for ", qname, "for", eTime.Sub(sTime))


}()



thanks, should be like this

Nanosecond() function just return int ( nano second in one second )



On Friday, November 25, 2016 at 4:39:50 PM UTC+8, Peter Wang wrote:
>
> you should use Sub function
> Time include two part.  Nanosecond method just return field of nsec.  not 
> nanoseconds  since from 1970
> type Time struct {
> // sec gives the number of seconds elapsed since
> // January 1, year 1 00:00:00 UTC.
> sec int64
> // nsec specifies a non-negative nanosecond
> // offset within the second named by Seconds.
> // It must be in the range [0, 9].
> nsec int32
> loc *Location
> }
>
> On Friday, November 25, 2016 at 3:38:23 PM UTC+8, Xu Lei wrote:
>>
>>
>> ..
>>
>> sTime := time.Now().Nanosecond()
>>
>>
>> defer func() {
>>
>>
>> eTime := time.Now().Nanosecond()
>>
>>
>> debug("Success for ", qname, "for", (eTime-sTime)/100)
>>
>>
>> }()
>>  
>> ..
>>
>>
>> i got negative value for (eTime - sTime) when defer function calls
>>
>> is there any thing wrong for this ?
>>
>> i used to thought that eTime should be greater then sTime
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: time sub negative

2016-11-25 Thread Dave Cheney
Are you running in a virtual machine?

What does this program print on your system?

https://play.golang.org/p/aYju210lhB

On Friday, 25 November 2016 19:35:54 UTC+11, Xu Lei wrote:
>
> os: windows7
> version: go version go1.7 windows/amd64
>
>
> On Friday, November 25, 2016 at 4:24:52 PM UTC+8, Dave Cheney wrote:
>>
>> You might want to try eTime.Sub(sTime) which returns a time.Duration 
>> which can print itself. 
>>
>> Which operating system are you using? Which version of Go are you using? 
>> Are you running in a virtual machine?
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Using the new plugin API to create a Go REPL

2016-11-25 Thread Jason Stillwell
https://github.com/dragonfax/go_repl_plugin_example

Its just a toy, but I thought it was an interesting idea.

You compile a plugin with the code the user typed, and then load that into 
the process and execute it.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: time sub negative

2016-11-25 Thread Peter Wang
you should use Sub function
Time include two part.  Nanosecond method just return field of nsec.  not 
nanoseconds  since from 1970
type Time struct {
// sec gives the number of seconds elapsed since
// January 1, year 1 00:00:00 UTC.
sec int64
// nsec specifies a non-negative nanosecond
// offset within the second named by Seconds.
// It must be in the range [0, 9].
nsec int32
loc *Location
}

On Friday, November 25, 2016 at 3:38:23 PM UTC+8, Xu Lei wrote:
>
>
> ..
>
> sTime := time.Now().Nanosecond()
>
>
> defer func() {
>
>
> eTime := time.Now().Nanosecond()
>
>
> debug("Success for ", qname, "for", (eTime-sTime)/100)
>
>
> }()
>  
> ..
>
>
> i got negative value for (eTime - sTime) when defer function calls
>
> is there any thing wrong for this ?
>
> i used to thought that eTime should be greater then sTime
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: time sub negative

2016-11-25 Thread Xu Lei
os: windows7
version: go version go1.7 windows/amd64


On Friday, November 25, 2016 at 4:24:52 PM UTC+8, Dave Cheney wrote:
>
> You might want to try eTime.Sub(sTime) which returns a time.Duration which 
> can print itself. 
>
> Which operating system are you using? Which version of Go are you using? 
> Are you running in a virtual machine?
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Bogdan Bursuc
+

On Fri, Nov 25, 2016 at 10:20 AM Konstantin Khomoutov <
flatw...@users.sourceforge.net> wrote:

> On Thu, 24 Nov 2016 23:59:18 -0800 (PST)
> Ainar Garipov  wrote:
>
> > Please no. Google Groups is awful, Reddit's /r/golang is where I get
> > most of my Go news. I don't want to sift through a forum with no
> > voting system, and awful and slow overly-JS-ed design.
>
> On a side note I continue to wonder why people struggle with crappy web
> stuff when they can just subscribe to this mailing list and get mail
> from it into their mailbox, and read/write mails there using convenient
> mail reader (with proper threads, searching tagging custom mail folders
> and so on).
>
> Google Groups is just a web front-end for those dirt-old but trusty
> mailing lists of the 90's ;-)
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Thanks,
Bogdan I. Bursuc

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] time sub negative

2016-11-25 Thread Dave Cheney
You might want to try eTime.Sub(sTime) which returns a time.Duration which can 
print itself. 

Which operating system are you using? Which version of Go are you using? Are 
you running in a virtual machine?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Konstantin Khomoutov
On Thu, 24 Nov 2016 23:59:18 -0800 (PST)
Ainar Garipov  wrote:

> Please no. Google Groups is awful, Reddit's /r/golang is where I get
> most of my Go news. I don't want to sift through a forum with no
> voting system, and awful and slow overly-JS-ed design.

On a side note I continue to wonder why people struggle with crappy web
stuff when they can just subscribe to this mailing list and get mail
from it into their mailbox, and read/write mails there using convenient
mail reader (with proper threads, searching tagging custom mail folders
and so on).

Google Groups is just a web front-end for those dirt-old but trusty
mailing lists of the 90's ;-)

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: do i need to wait all child routine exit

2016-11-25 Thread Xu Lei
thanks for replying!!!

the answers are great

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: time sub negative

2016-11-25 Thread Xu Lei


2016-11-25 15:36:21.9983037 +0800 CST : [Success for  beacons.gvt2.com. for 38]
2016-11-25 15:36:22.0083043 +0800 CST : [Success for  timgsa.baidu.com. for 
-960]
2016-11-25 15:36:22.0153047 +0800 CST : [Success for  sp0.baidu.com. for -953]
2016-11-25 15:36:22.0153047 +0800 CST : [Success for  ss1.bdstatic.com. for 
-954]
2016-11-25 15:36:22.0163047 +0800 CST : [Success for  ss1.baidu.com. for -953]
2016-11-25 15:36:22.0163047 +0800 CST : [Success for  ss0.bdstatic.com. for 
-952]
2016-11-25 15:36:22.0413062 +0800 CST : [Success for  ss2.baidu.com. for -956]
2016-11-25 15:36:22.0703078 +0800 CST : [Success for  ss2.bdstatic.com. for 60]
2016-11-25 15:36:22.0723079 +0800 CST : [Success for  ss3.baidu.com. for 55]
2016-11-25 15:36:22.074308 +0800 CST : [Success for  ss3.bdstatic.com. for 56]



-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.