[go-nuts] Re: On Accepting Interfaces and Structs

2018-04-23 Thread Kaveh Shahbazian
Thanks @Louki, The names are absolutely made up and are just for the purpose of demonstration. The problem is the package state, one whole package to just hold a type. On Tuesday, April 24, 2018 at 10:36:29 AM UTC+4:30, Louki Sumirniy wrote: > > The name could use some work, stutter is a no-no

[go-nuts] Re: go lang best practices and git repo structure for newbies

2018-04-23 Thread Louki Sumirniy
This git repository shows an example of all the common conventions for build layout https://github.com/golang-standards/project-layout On Tuesday, 24 April 2018 08:26:49 UTC+3, vteja...@gmail.com wrote: > > Thank you Matt, I will start reading as you mentioned. > > BR, > Teja > > On Monday, April

[go-nuts] Re: On Accepting Interfaces and Structs

2018-04-23 Thread Louki Sumirniy
The name could use some work, stutter is a no-no in Go. What kind of state does it hold? User profiles? MMO game world database? Is your scope too broad? I see that it looks like a geography database, so it would make more sense to call it 'geo' or something like this. Also, for such a database

[go-nuts] Re: On Accepting Interfaces and Structs

2018-04-23 Thread Kaveh Shahbazian
@Jake @Bryan Thanks! Current solution I use: A package that holds the shared data type State: package state type State struct { Latitude float64 Longitude float64 Mark string Name string // ... } Three packages with different implementations and algorithms: pack

Re: [go-nuts] best practices for gccgo and external packages

2018-04-23 Thread Philip Brown
On Mon, Apr 23, 2018 at 9:23 PM, Ian Lance Taylor wrote: > > > There is no -buildmode=archive. Using -buildmode=c-archive should > work if that is what you want to do. > ORLLY? :-} $ go help buildmode The 'go build' and 'go install' commands take a -buildmode argument which indicates which kind

[go-nuts] Re: go lang best practices and git repo structure for newbies

2018-04-23 Thread vtejaswini1
Thank you Matt, I will start reading as you mentioned. BR, Teja On Monday, April 23, 2018 at 8:36:00 PM UTC+2, matthe...@gmail.com wrote: > > Hi Teja, > > I found Effective Go to be generally helpful: > https://golang.org/doc/effective_go.html > > Here’s my best example: https://github.com/pciet

Re: [go-nuts] Allow name : type declarations?

2018-04-23 Thread Ian Lance Taylor
On Sat, Apr 21, 2018 at 3:50 PM, Hugh Fisher wrote: > > I'm a new Go programmer (learning in my spare time) and decided to share my > initial fumbles and what? why? moments while they're still fresh. > > First suggestion: allow a colon to be inserted between the name(s) and type > in declarations.

[go-nuts] schollz/peerdiscovery - Pure-Go library for cross-platform local peer discovery using UDP broadcast

2018-04-23 Thread zack . scholl
After a few hours of mild hair pulling with trying to get the pkg/net ReadFromUDP to work between Windows and Linux, I eventually just went with golang.org/x/net/ipv4 to write this little library that can be used for local p

[go-nuts] Re: Problem using ReadFromUDP on Windows to discover local peers

2018-04-23 Thread zack . scholl
I got it working! Got it working with golang.org/x/net/ipv4, for some reason the pkg/net ReadFromUDP just didn't work. On Monday, April 23, 2018 at 12:07:07 AM UTC-7, zack@gmail.com wrote: > > I wrote a library (schollz/peerdiscovery > ) for discover

Re: [go-nuts] best practices for gccgo and external packages

2018-04-23 Thread Ian Lance Taylor
On Mon, Apr 23, 2018 at 6:40 PM, Philip Brown wrote: > > the docs at > https://golang.org/doc/install/gccgo > seem to mention how to use packages for your own code, but dont mention how > to use third party packages. > > In other words, in situations where you would normally do > > go get github.o

Re: [go-nuts] [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-23 Thread Dan Kortschak
The freetype license looks it's a BSD derivative. That license would be more consistent with the static linking used by gc, so since you can choose either the freetype license or the GPL 2+, if it's not against your ideals, the FTL is probably the better choice. Note that because oksvg imports rast

[go-nuts] best practices for gccgo and external packages

2018-04-23 Thread Philip Brown
the docs at https://golang.org/doc/install/gccgo seem to mention how to use packages for your own code, but dont mention how to use third party packages. In other words, in situations where you would normally do go get github.org/blah/somepackage What should you do for gccgo, once you have do

Re: [go-nuts] [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-23 Thread Steven Wiley
Thanks for the compliments, everyone. I will check out the vector package and further test SVG examples are welcome. If I have isolated concepts as well as I hope I have, re-writing the Scanner to use the vector package might not be too hard. Gradients are also near the top of the to-do list,

Re: [go-nuts] [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-23 Thread Nigel Tao
Nice! On Mon, Apr 23, 2018 at 3:41 AM, Steven Wiley wrote: > I refactored and enhanced the raster package from the golang translation > of freetype, > It'd be a bunch of work, but you might consider basing off of golang.org/x/image/vector instead: 1. Its

[go-nuts] Re: On Accepting Interfaces and Structs

2018-04-23 Thread 'Bryan Mills' via golang-nuts
I agree with Jake: a more complete example would be helpful. In my experience, this sort of issue is often a symptom of awkward package boundaries. If you can find a more natural package boundary, you may be able to sidestep the problem. (There are certainly some cases where the lack of covaria

Re: [go-nuts] Type func binding and interfaces

2018-04-23 Thread Jan Mercl
On Mon, Apr 23, 2018 at 8:58 PM Louki Sumirniy < louki.sumirniy.stal...@gmail.com> wrote: > The type function bindings are not the problem, the problem is the fact that despite in every other way the signatures match, they will not be found by the compiler to bind to the type, and thus the need to

Re: [go-nuts] Type func binding and interfaces

2018-04-23 Thread Louki Sumirniy
The type function bindings are not the problem, the problem is the fact that despite in every other way the signatures match, they will not be found by the compiler to bind to the type, and thus the need to wrap the invocations. I maybe should explain that I have had some experience programmin

[go-nuts] Re: [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-23 Thread Daniel Theophanes
The sample raster images look great! Right now, due to how Go statically links code I can't use GPL code in just about anything I use Go for. I totally respect your license decision, but, it may be a poorer fit for Go... On Sunday, April 22, 2018 at 10:41:07 AM UTC-7, Steven Wiley wrote: > > Hi

[go-nuts] Re: go lang best practices and git repo structure for newbies

2018-04-23 Thread matthewjuran
Hi Teja, I found Effective Go to be generally helpful: https://golang.org/doc/effective_go.html Here’s my best example: https://github.com/pciet/wichess My golang-nuts code review points: - don’t overuse interface (consider closures and function types/fields) - don’t overuse packages, make mor

[go-nuts] Re: Flutter and golang

2018-04-23 Thread Ged Wed
It's because your compiling to the wrong ISA. If it's an emulator then you need to gomobile bind to x86. -- 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-n

[go-nuts] Re: Flutter and golang

2018-04-23 Thread Ged Wed
I used to build only web based up. But you hit so many corner cases. With flutter you get pixel perfect control as deep as you need. To me you get much higher quality UI from flutter. And you don't have a untyped web runtime designed 20 years ago to deal with. My harsh 2 cents I admit... But real

[go-nuts] go lang best practices and git repo structure for newbies

2018-04-23 Thread vtejaswini1
Hello, I was quite new to go lang. It would be good if anyone can help with best practices and practical git repo structure example for getting inspiration to kick start. Thanks, Teja -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubsc

Re: [go-nuts] Re: Accessing Slices Made From Same Array Concurrently

2018-04-23 Thread Kaveh Shahbazian
@rog Thanks! Three-value slice operator was a very nice hint. The original intention was to implement a buffer-pool (pool of []byte) without fragmenting the memory. But I was not sure if I was doing it right. Seems now, assuming the pool consumers are polite goroutines, this can be a good solut

Re: [go-nuts] Type func binding and interfaces

2018-04-23 Thread roger peppe
On 22 April 2018 at 23:20, Louki Sumirniy wrote: > I essentially am trying to find an effective method in Go, preferably not > too wordy, that lets me create an abstract data type, a struct, and a set of > functions that bind to a different data type, and that I can write, > preferably not in too

[go-nuts] Re: [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-23 Thread ajstarks
I'm very glad to see this. FYI, [1] has a bunch of examples for testing. It will be nice to have a pure Go tool chain for both generation and rendering. [1] https://github.com/ajstarks/deck/tree/master/cmd/codepicdeck/code On Sunday, April 22, 2018 at 1:41:07 PM UTC-4, Steven Wiley wrote: > >

[go-nuts] Re: On Accepting Interfaces and Structs

2018-04-23 Thread jake6502
My gut feeling is that there is an elegant way to achieve what you want. Unfortunately, I am having trouble following the code you are describing, and more importantly, what you are actually trying to accomplish. Perhaps it is my failing. If you would post a more complete example, showing the

[go-nuts] Re: Type func binding and interfaces

2018-04-23 Thread matthewjuran
Is the need for a memory efficient implementation backed by a performance profile? Matt On Monday, April 23, 2018 at 10:26:41 AM UTC-5, Louki Sumirniy wrote: > > First issue is that BAST does not use references. This is so that searches > proceed linearly through memory. Instead it uses a flat

[go-nuts] It was removed some packages from go.googlesource.com

2018-04-23 Thread Tamás Gulácsi
vgo is missing, 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

[go-nuts] Re: Type func binding and interfaces

2018-04-23 Thread Louki Sumirniy
First issue is that BAST does not use references. This is so that searches proceed linearly through memory. Instead it uses a flat array that it cuts into sequentially doubling sized rows, representing the slots that a binary tree has. Secondly, you just complicated my design even further with

Re: [go-nuts] liteide x33.3 released

2018-04-23 Thread Steven Wiley
Thank you! FYI, here is a working link for the first release downloads https://github.com/visualfc/liteide/releases/tag/x33.3 On Sunday, April 22, 2018 at 11:28:18 PM UTC-7, visualfc wrote: > > Hi all. > LiteIDE x33.3 released! > This version support import line jump to package source file, supp

[go-nuts] Re: vgo get fatal error: 'stdlib.h' file not found

2018-04-23 Thread nvcnvn
Ah, never mind... sorry for the noise! This is seem an issue of my OS. (After install glibc-devel I got a different error message) On Monday, April 23, 2018 at 9:29:12 PM UTC+7, nvcnvn wrote: > > Do I need to install any C related thing for this vgo tool? Why the normal > Go tool work normal (I'm

[go-nuts] vgo get fatal error: 'stdlib.h' file not found

2018-04-23 Thread nvcnvn
Do I need to install any C related thing for this vgo tool? Why the normal Go tool work normal (I'm able to run go get for the lib/pq package) > $ go version > go version go1.10.1 linux/amd64 > $ vgo version > go version go1.10.1 linux/amd64 vgo:2018-02-20.1 > $ vgo get github.com/lib/pq > # run

[go-nuts] Re: Type func binding and interfaces

2018-04-23 Thread matthewjuran
> > But I don't want to tie my users down to integers and floats. What if they > want to sort strings? What if they want to sort complex numbers, matrixes, > or what have you? This is what the interface concept was made for. Why would the implementation of IsLeft be different if the BAST data

[go-nuts] It was removed some packages from go.googlesource.com

2018-04-23 Thread takanao ENDOH
Hi, guys. Could not `go get golang.org/x/lint/golint`. Is it working normally? Seems it was removed some packages from https://go.googlesource.com/ . webcache: http://webcache.googleusercontent.com/search?q=cache%3Ago.googlesource.com%2F Thanks for your checking. -- You received this message

[go-nuts] Re: Type func binding and interfaces

2018-04-23 Thread Louki Sumirniy
I did look at the Red/Black tree on Github and that was what got me started. But you need to understand exactly why those functions seem great in number. First of all, of course you could swap out 3 of those comparators for 1, and you probably don't even get why there is the 'empty' one. The da

Re: [go-nuts] Re: Accessing Slices Made From Same Array Concurrently

2018-04-23 Thread roger peppe
You original example has a problem that others have pointed out because it's possible for one goroutine to step on the part of the backing array used by others. In principle though your technique looks OK to me as long as you prevent that happening, for example by using the three-value slice operat

[go-nuts] Re: Type func binding and interfaces

2018-04-23 Thread matthewjuran
This is a code smell for me: type BAST interface { AddRow() error IsLeft(interface{}, Cursor) bool IsRight(interface{}, Cursor) bool IsEqual(interface{}, Cursor) bool IsEmpty(Cursor) bool … Interfaces should be small. This looks like a class definition which isn’t a Go patter

[go-nuts] Re: Accessing Slices Made From Same Array Concurrently

2018-04-23 Thread Kaveh Shahbazian
Also -race does not complain about this: https://play.golang.org/p/IeA4npcemf5 On Monday, April 23, 2018 at 10:51:05 AM UTC+4:30, Kaveh Shahbazian wrote: > > @Silviu The code is mutating same item from two goroutines. While the > original target is to create a buffer pool that their items is not

[go-nuts] Re: Global variable not used, but it works fine

2018-04-23 Thread Vladimir Varankin
I think it's way harder to guaranty that the globals aren't used since even non-exported functions/varibles can be used by the linker. On Saturday, April 21, 2018 at 3:30:22 PM UTC+2, 子風 wrote: > > What did you do? > https://play.golang.org/p/aryK9Btv5kH > > What did you expect to see?

[go-nuts] Re: Type func binding and interfaces

2018-04-23 Thread Louki Sumirniy
I spent two hours wrestling with this, but as you can see in this playground, the method I proposed totally works: https://play.golang.org/p/FMvisWS9tuP I propose that the type builtin when dealing with functions should have an extension made to it to add the method binding to the type signatur

[go-nuts] Problem using ReadFromUDP on Windows to discover local peers

2018-04-23 Thread zack . scholl
I wrote a library (schollz/peerdiscovery ) for discovering peers on a local network. I've tested it between a wireless ubuntu laptop and a wired ubuntu server and it works great. Basically you can run the following on computer 1 and computer 2: go g