[go-nuts] Re: Bizarre linker error when creating custom GOOS for Webassembly stuff

2018-09-07 Thread Seven Dang
import ( "fmt" ) used : fmt.Println("HELO MOTO") On Thursday, September 6, 2018 at 8:59:48 PM UTC+7, Christine Dodrill wrote: > > Hello, > > I am working on server-side webassembly stuff and the fact that I am not a > javascript interpreter was getting in the way due to nearly all the >

[go-nuts] Re: Upload Website Golang on Linux ( centOS 7) - Help me!

2018-09-07 Thread Seven Dang
Group, help me! thank so much... very so much On Thursday, September 6, 2018 at 5:11:16 PM UTC+7, Seven Dang wrote: > > I upload website build Golang on Linux (centOS 7) > > Folder Website > > public > --- views > |-backend > |-frontend > main ( build) >

[go-nuts] Re: Help

2018-09-07 Thread Seven Dang
oh oh package config import ( "fmt" // _ "github.com/lib/pq" "gopkg.in/mgo.v2" "time" ) // database var DBmgo *mgo.Database // collections var UserAgent *mgo.Collection func init() { info := { Addrs: []string{"ip:port"}, Timeout: 1 * time.Hour,

[go-nuts] Re: Performance regression of HTTP requests since Go 1.11

2018-09-07 Thread 'mrauh' via golang-nuts
Very helpful, thanks! -- 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

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread Ian Lance Taylor
On Thu, Sep 6, 2018 at 4:29 PM, Axel Wagner wrote: > > The other day I had a lengthy conversation with Rog Peppe, David Crawshaw > and Nate Finch on twitter and I'd argue that neither of us would really > count as a Go-novice and we *still* weren't always clear what types certain > contracts

Re: [go-nuts] Reflecting on an outer struct from a method of an inner one.

2018-09-07 Thread ianbruene
On Friday, September 7, 2018 at 3:01:23 AM UTC-5, Nigel Tao wrote: > > Building on Todd's example, you can add a little more type safety > (having the map value type be a "func etc" instead of "reflect.Value) > by Curry'ing the receiver: https://play.golang.org/p/n3sDpxfd2td > > I've also

Re: [go-nuts] Why can't we use unicode? [Go2 Generics]

2018-09-07 Thread 'Ian Cottrell' via golang-nuts
The same thing works in any X system that supports compose, probably bound to the Shift+AltGr On Fri, Sep 7, 2018 at 12:29 PM roger peppe wrote: > In acme (and plan 9 generally), there's a nice set of mnemonic > abbreviations for unicode characters. > It's great, and I miss it in other

[go-nuts] Re: Reflecting on an outer struct from a method of an inner one.

2018-09-07 Thread ianbruene
On Thursday, September 6, 2018 at 6:34:54 PM UTC-5, Eric Raymond wrote: > In the attached program, I would like to be able to remove the argument > from ListFields. That is, I want the Inner code to be able to reflect on > the Outer instance without having to be fed the address of the Outer

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread Larry Clapp
> > "If the contract body uses a type in a certain way, the actual > function is permitted to use the type in the same way." > I like the idea of this, and it feels like it *should* be intuitive, > but the problem is that "in a certain way" needs to be very well > defined. "This is

Re: [go-nuts] Why can't we use unicode? [Go2 Generics]

2018-09-07 Thread roger peppe
In acme (and plan 9 generally), there's a nice set of mnemonic abbreviations for unicode characters. It's great, and I miss it in other environments. Alt-<< and Alt->> work really well for « and » for example. Here's the full list: https://github.com/9fans/plan9port/blob/master/lib/keyboard On 7

Re: [go-nuts] Why can't we use unicode? [Go2 Generics]

2018-09-07 Thread Jan Mercl
On Fri, Sep 7, 2018 at 6:29 PM roger peppe wrote: > In acme (and plan 9 generally), there's a nice set of mnemonic > abbreviations for unicode characters. > It's great, and I miss it in other environments. Alt-<< and Alt->> > work really well for « and » for example. > Here's the full list: >

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread Ian Lance Taylor
On Fri, Sep 7, 2018 at 10:51 AM, jimmy frasche wrote: > > To describe a sufficiently-tight contract you need to be able to come > up with an elaborate conjunction of properties that allow everything > needed while disallowing everything that would cause your code to > break. To read such a

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread 'Axel Wagner' via golang-nuts
On Fri, Sep 7, 2018 at 3:10 PM Ian Lance Taylor wrote: > This does surprise me. I'm certainly too close to the problem, but to > me it always seems quite clear which type arguments a contract allows > and excludes. It's exactly the set of types that type check successfully. I yield that it's

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread Ian Lance Taylor
On Fri, Sep 7, 2018 at 11:39 AM, Axel Wagner wrote: > On Fri, Sep 7, 2018 at 3:10 PM Ian Lance Taylor wrote: >> >> This does surprise me. I'm certainly too close to the problem, but to >> me it always seems quite clear which type arguments a contract allows >> and excludes. It's exactly the set

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread roger peppe
The key sentence from the draft is this: "If the contract body uses a type in a certain way, the actual function is permitted to use the type in the same way." I like the idea of this, and it feels like it *should* be intuitive, but the problem is that "in a certain way" needs to be very well

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread jimmy frasche
On Fri, Sep 7, 2018 at 6:10 AM Ian Lance Taylor wrote: > > On Thu, Sep 6, 2018 at 4:29 PM, Axel Wagner > wrote: > > > > The other day I had a lengthy conversation with Rog Peppe, David Crawshaw > > and Nate Finch on twitter and I'd argue that neither of us would really > > count as a Go-novice

Re: [go-nuts] A thought on contracts

2018-09-07 Thread Mandolyte
I think it worth noting that a contract also makes good documentation for godoc. Thus a win for all users of generic libraries. -- 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,

Re: [go-nuts] Re: [ANN] goey - Declarative, cross-platform GUIs

2018-09-07 Thread robert engels
I might be able to do it if there was a “porting guide” that describes what needs to be - at least in general terms - rather than just looking at the existing code and making a guess > On Sep 7, 2018, at 10:01 AM, Robert Johnstone wrote: > > Hello, > > I would be very happy to support macOS,

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread robert engels
I think the 90% rule applies… if we can have a simple solution that covers 90%, rather than a complex one to cover 100%, go with the simple. There are always trade-offs in development - having simple, easy to understand tools always wins out IMO - because greater adoption and usage is key. >

Re: [go-nuts] A thought on contracts

2018-09-07 Thread Robert Johnstone
Hello, This seems more like a question for tooling. It has already been discussed that there should be a tool to read a body and provide a minimised or canonical contract. Perhaps we forgo writing the contract in code, and rely on godoc to determine the contract for the documentation? The

Re: [go-nuts] [go-mod] sub-modules & required Go version

2018-09-07 Thread Paul Jolly
> 2) what's the story with "submodules" ? Submodules work. But if you can get away with just a single module, then do :) Because submodules are dependencies nonetheless, and with them comes the overhead of managing those dependencies. Clearly with modules that process is made much simpler, but

Re: [go-nuts] Why can't we use unicode? [Go2 Generics]

2018-09-07 Thread Larry Clapp
Need more shift keys! I'm pretty sure if I used them every day, I'd learn pretty quickly that « & » are from opt-\ and shift-opt-\, and ‹ & › are from shift-opt-3 & 4. Windows users ... are on their own. Find a use for the otherwise-poorly-used numeric keypad, maybe. (Sometimes I wish Macs

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread Larry Clapp
> > contract { var _ map[T]bool } Would this contract allow T to be used in a map to some other type than bool? e.g. map[T]int? If so, why? Why is bool a stand-in for "any type"? (I apologize if this has been dealt with elsewhere; this is a big topic.) On Thursday, September 6, 2018 at

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread Larry Clapp
Never mind, I found it. The draft proposal says To validate the type arguments, each of the contract’s parameter types is > replaced with the corresponding type argument [...]. The body of the > contract is then type checked as though it were an ordinary function. If > the type checking

[go-nuts] Re: [ANN] goey - Declarative, cross-platform GUIs

2018-09-07 Thread Robert Johnstone
Hello, I would be very happy to support macOS, but unfortunately I don't have any experience on that platform. Sorry, no concrete plans. - Robert On Thursday, 6 September 2018 19:44:52 UTC-4, Richard Wilkes wrote: > > Hi, Robert. > > Do you have any plans to add macOS support to this? > > -

Re: [go-nuts] Why can't we use < > for the Go generic parameters ?

2018-09-07 Thread alan . fox6
Whilst I could live with square brackets, I prefer round brackets too and still would do even if angle brackets were available. This is because when I see different types of brackets following an identifier, I (and probably many others) tend to associate them as follows: 1. square brackets ->

Re: [go-nuts] Why can't we use unicode? [Go2 Generics]

2018-09-07 Thread Michael Jones
I brought this up way back in the early days. There will be an old post. The fear is mental inertia and muscle memory -- a new-to-beginners character set would not "sell". An easy compromise is go vet: it can translate between '>=" to '≥' rather easily. On Fri, Sep 7, 2018 at 6:17 AM Larry

[go-nuts] Re: Bizarre linker error when creating custom GOOS for Webassembly stuff

2018-09-07 Thread Christine Dodrill
That doesn't work. I don't know if the standard library works yet. All I am caring about right now is package runtime. On Friday, September 7, 2018 at 12:15:23 AM UTC-7, Seven Dang wrote: > > import ( >"fmt" > ) > > used : > fmt.Println("HELO MOTO") > > On Thursday, September 6, 2018 at

Re: [go-nuts] A thought on contracts

2018-09-07 Thread Tristan Colgate
You lose the ability to see changes of contract in your diff (which I think is the thing I most want). On Fri, 7 Sep 2018 at 15:56 Robert Johnstone wrote: > Hello, > > This seems more like a question for tooling. It has already been > discussed that there should be a tool to read a body and

Re: [go-nuts] Repeated functions with the same output in loops

2018-09-07 Thread Sergey Kamardin
> Note that calculating the length of a slice is a fast operation; it's > a single memory load. So, actually it just loads a slice header's field? On Thu, 09/06/18, fff Sep 06, 2018 at 12:56:36PM -0700, Ian Lance Taylor wrote: > On Thu, Sep 6, 2018 at 12:24 PM, mustafa katipoğlu >

Re: [go-nuts] Re: Strange rebuilds of stdlib packages with Go 1.11

2018-09-07 Thread Paul Jolly
See https://github.com/golang/go/issues/26993 and https://github.com/golang/go/issues/26988, specifically https://github.com/golang/go/issues/26988#issuecomment-417886417 On Tue, 4 Sep 2018 at 12:24, Volker Dobler wrote: > > Has anybody experience the same behaviour? > Am I doing something wrong?

Re: [go-nuts] Re: Upload Website Golang on Linux ( centOS 7) - Help me!

2018-09-07 Thread Ian Lance Taylor
On Fri, Sep 7, 2018 at 12:18 AM, Seven Dang wrote: > Group, help me! thank so much... very so much > I'm sorry, I don't understand your question. I don't understand what it has to do with Go at all. You seem to be asking about systemd and systemctl. These are not parts of the Go

Re: [go-nuts] Reflecting on an outer struct from a method of an inner one.

2018-09-07 Thread Nigel Tao
Building on Todd's example, you can add a little more type safety (having the map value type be a "func etc" instead of "reflect.Value) by Curry'ing the receiver: https://play.golang.org/p/n3sDpxfd2td I've also split up the single run function into two: one binds strings to functions, the second

Re: [go-nuts] Why can't we use < > for the Go generic parameters ?

2018-09-07 Thread Sebastien Binet
Bikesheding mode on... On Fri, Sep 7, 2018, 00:06 jimmy frasche wrote: > I'd quite prefer [] over (). It would make F[t](v) distinct from > F(x)(y) even if it's not distinct from m[x](y). > One could add a dot, like for type checking: F.[T](y) Yet another rule to learn... :) -s On Thu, Sep

[go-nuts] go modules introspection

2018-09-07 Thread Jens Hausherr
Hi , is there a way to acces go module information programmatically? Background: I am currently using spf13's cobra. It currently only works with packages inside GOPATH. Is there a clean way to identify if the current working directory is a go module and to get module information from go.mod

Re: [go-nuts] go mod impressions

2018-09-07 Thread Paul Jolly
For "global" installs of a tool via go (get|install), this is indeed a critical feature and is covered by https://github.com/golang/go/issues/24250. ("global" is defined as: outside of a module context (i.e. no go.mod), with GO111MODULE=on) Within a module context, i.e. with a go.mod present, go

Re: [go-nuts] go modules introspection

2018-09-07 Thread Paul Jolly
Hi Jens, > Is there a clean way to identify if the current working directory is a go > module and to get module information from go.mod (i.e. a parser fo go.mod > files)? go env GOMOD > I did seach the documentation on golang.org but could not find any > information. Depends on what you

[go-nuts] how to convert big.Float to big.Int

2018-09-07 Thread Shiming Liu
Hi you guys, do you know how to convert big.Float to big.Int, I have searched with google and searched in this group, but don't found valuable info. In stackoverflow I got an answer https://stackoverflow.com/questions/47545898/golang-convert-big-float-to-big-int , but it's use big.Float -->

Re: [go-nuts] how to convert big.Float to big.Int

2018-09-07 Thread Ian Lance Taylor
On Fri, Sep 7, 2018 at 3:43 AM, Shiming Liu wrote: > > Hi you guys, do you know how to convert big.Float to big.Int, I have > searched with google and searched in this group, but don't found valuable > info. > > In stackoverflow I got an answer >

Re: [go-nuts] how to convert big.Float to big.Int

2018-09-07 Thread Jan Mercl
On Fri, Sep 7, 2018 at 12:51 PM Shiming Liu wrote: > Hi you guys, do you know how to convert big.Float to big.Int, I have searched with google and searched in this group, but don't found valuable info. (*big.Float) Int() does that: https://golang.org/pkg/math/big/#Float.Int -- -j -- You

Re: [go-nuts] Repeated functions with the same output in loops

2018-09-07 Thread Ian Lance Taylor
On Fri, Sep 7, 2018 at 1:41 AM, Sergey Kamardin wrote: >> Note that calculating the length of a slice is a fast operation; it's >> a single memory load. > > So, actually it just loads a slice header's field? Yes. Ian -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Why can't we use < > for the Go generic parameters ?

2018-09-07 Thread Tyler Compton
I agree with Alan and I actually think the parentheses-based syntax is fine. In Go as it is now, there is no case where using brackets on a variable results in a call to code somewhere else in the project. It's always some kind of indexing operation. Parenthesis have a history of doing this with

[go-nuts] Re: Os/Exec problematic quotation marks

2018-09-07 Thread Daniel Estiven Rico Posada
Thanks to Volker and Tyler for the answers. It was very useful. El miércoles, 5 de septiembre de 2018, 3:32:44 (UTC-5), Daniel Estiven Rico Posada escribió: > > Hello, > > Actually i'm working in a go application that receive a http request and > start some windows assistants. (RPA's) > > The

[go-nuts] Re: Announcing gophersat, a SAT and Pseudo-Boolean solver, v1.0.0

2018-09-07 Thread Scott Cotton
Hi, Gini was benchmarked on a reasonably sized set of randomly selected sat competition problems against minisat and picosat. It did very well, before there was even gophersat. SAT competition problems are much harder than many application use case problems because they are of interest as a

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread Rob Pike
contract unsigned(v T) { // Require T to be an integer type. v % 1 // This is satisfied by any unsigned integer type, but not by a signed integer type. v = 1<<(unsafe.Sizeof(v) * 8 - 1) } That requires an import, not to mention unsafe, which raises the issue of whether a contract

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread Rob Pike
Would this work? contract unsigned(u T) { 1 << u } It's another infelicitous horror, but I believe it exploits the only place in the language where an unsigned integer is required. -rob -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Local cache of dependencies

2018-09-07 Thread Paul Jolly
See also https://groups.google.com/d/msg/golang-dev/mNedL5rYLCs/OGjRDTmWBgAJ On Wed, 22 Aug 2018 at 23:34, Conor Hackett wrote: > > Hey Guys, > > So, adding your "vendor" directory to SCM is a contentious topic at best. > > I personally would rather not vendor the dependencies but I do need to

[go-nuts] Re: Local repository for go modules

2018-09-07 Thread Paul Jolly
> > I think you could go down the Athens path if you wanted to, but I don't > think you need to do so. > See also https://groups.google.com/forum/#!msg/golang-dev/mNedL5rYLCs/OGjRDTmWBgAJ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Why can't we use < > for the Go generic parameters ?

2018-09-07 Thread roger peppe
Personally, I'm happy with the choice to use round brackets. Go started down this road a long time ago, in my view, by making type conversions look like function calls. When `typename(x)` is qualitatively different from `value(x)`, I think it's quite reasonable that `x(typename)` is

Re: [go-nuts] Reflecting on an outer struct from a method of an inner one.

2018-09-07 Thread roger peppe
Ha, I wrote this version before I saw that response: https://play.golang.org/p/vO2TI7OeJk_E On 7 September 2018 at 09:00, Nigel Tao wrote: > Building on Todd's example, you can add a little more type safety > (having the map value type be a "func etc" instead of "reflect.Value) > by Curry'ing

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread Lucio
On Friday, 7 September 2018 20:47:42 UTC+2, Ian Lance Taylor wrote: > > > I think your contracts do require signedness and unsignedness. When > you ask whether `i << 1` should permit shifting by values other than > 1, you are going back to the question of what generic function bodies > are

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-07 Thread Lucio
On Saturday, 8 September 2018 06:19:09 UTC+2, Lucio wrote: > What my uneducated eye sees at the core of the proposed contracts is a > new, extended approach to defining *types*, that assigns categories to them > (classes, of course) based - as interfaces are, for user-defined types - > on

Re: [go-nuts] Why can't we use unicode? [Go2 Generics]

2018-09-07 Thread Lucio
On Friday, 7 September 2018 18:39:38 UTC+2, Ian Cottrell wrote: > > The same thing works in any X system that supports compose, probably bound > to the Shift+AltGr > >> >> So, how do you apply an uppercase shift, when necessary, if you're already holding it down at the time? Or is Shift+AltGr

[go-nuts] Announcement: goutmp - Go bindings to maintain the traditional UNIX utmp/utmpx and lastlog, used for tracking remote terminal sessions

2018-09-07 Thread Nuclear Squid!!
https://blitter.com/gogs/Russtopia/goutmp Mirror: https://github.com/Russtopia/goutmp Trivial really.. but the go standard packages didn't seem to have any bindings for these APIs. README.md -- goutmp - Minimal bindings to C stdlib pututmpx(), getutmpx() (/var/log/wtmp) and /var/log/lastlog