[go-nuts] Having a Model Package

2017-12-15 Thread dc0d
I've been reading the other day: "having a model package, is considered a code smell, in Go". 1 - Why? 2 - If so, what approach should be chosen? 3 - And how? (In Go code, Go features to employ, Patterns (small/big projects), etc) -- You received this message because you are subscribed to

Re: [go-nuts] XML Pretty Print

2017-12-15 Thread Tamás Gulácsi
A natural choice for xml pretty printing is xmllint from libxmltools-bin. -- 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

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Ian Lance Taylor
The technique of generating an object file directly from the compiler does not have a name. Many other compilers do the same thing For example, clang/LLVM does it. These questions about how compilers work do not have anything to do with Go, and I encourage you to take them to some other group.

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Compiler
No Answer?! On Saturday, December 16, 2017 at 3:38:04 AM UTC+3:30, Compiler wrote: > > hmmm , > what is name of this way for generate executable file at compiler? > > On Saturday, December 16, 2017 at 3:34:27 AM UTC+3:30, andrey mirtchovski > wrote: >> >> > so go compiler generate what?! >> >>

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Compiler
Tanks You. https://github.com/kostya/benchmarks Rust in many tests/samples is better of Go.(Performance) On Saturday, December 16, 2017 at 4:07:49 AM UTC+3:30, Bakul Shah wrote: > > Everything you have asked about has been covered multiple > times but you will have to do some research on your

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Bakul Shah
Everything you have asked about has been covered multiple times but you will have to do some research on your own. May I suggest reading some documentation on the golang.org website as well as watching go language related videos? You can also search for related discussions on this mailing list.

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Dave Cheney
Just to be clear, I wasn’t being serious. But then again, I’m starting to think that you aren’t being serious either. -- 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

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Compiler
mean many go developer will switch to Rust? but RUST is also google's Lang. why when google have a good lang why begin write new lang(go)?! On Saturday, December 16, 2017 at 3:43:58 AM UTC+3:30, Dave Cheney wrote: > > I think we should all switch to rust. -- You received this message because

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Dave Cheney
I think we should all switch to rust. -- 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] Go Compiler How Work?!

2017-12-15 Thread Compiler
hmmm , what is name of this way for generate executable file at compiler? On Saturday, December 16, 2017 at 3:34:27 AM UTC+3:30, andrey mirtchovski wrote: > > > so go compiler generate what?! > > https://golang.org/cmd/compile/ > > Compile, typically invoked as “go tool compile,” compiles a

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Compiler
what you think about this?! On Saturday, December 16, 2017 at 3:27:24 AM UTC+3:30, Compiler wrote: > > https://github.com/kostya/benchmarks > > at many sample/tests Rust is better of Go.(Performance) > > On Saturday, December 16, 2017 at 3:22:14 AM UTC+3:30, andrey mirtchovski > wrote: >> >> >

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread andrey mirtchovski
> so go compiler generate what?! https://golang.org/cmd/compile/ Compile, typically invoked as “go tool compile,” compiles a single Go package comprising the files named on the command line. It then writes a single object file named for the basename of the first source file with a .o suffix. The

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread andrey mirtchovski
> Last Version of Go Compiler doing Generate `ASM Code` and next Linker... and > make final binary output file for they platform? The modern Go compilers (https://golang.org/cmd/compile/, gccgo) do not generate "ASM Code" unless an appropriate flag is presented to them. For the "compile" tool

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Compiler
Tanks you. please also answer my first question. Last Version of Go Compiler doing Generate `ASM Code` and next Linker... and make final binary output file for they platform? On Saturday, December 16, 2017 at 3:17:31 AM UTC+3:30, Gianguido Sorà wrote: > > No, Go doesn't use LLVM. > > Il 16

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread andrey mirtchovski
> Why not Use?! The Go team felt LLVM was too large and slow to meet their performance goals. -- 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

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Compiler
Why not Use?! This not more Easy? Google Team/Co at RustLang is using LLVM. On Saturday, December 16, 2017 at 3:17:31 AM UTC+3:30, Gianguido Sorà wrote: > > No, Go doesn't use LLVM. > > Il 16 dic 2017 00:45, "Compiler" ha > scritto: > >> Last Version of Go Compiler doing

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Gianguido Sorà
No, Go doesn't use LLVM. Il 16 dic 2017 00:45, "Compiler" ha scritto: > Last Version of Go Compiler doing Generate `ASM Code` and next Linker... > and final binary output file? > > > Go Compiler is use LLVM/IR? > > > go1.4/doc/go_faq.html : > > We considered using LLVM

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Compiler
Last Version of Go Compiler doing Generate `ASM Code` and next Linker... and final binary output file? Go Compiler is use LLVM/IR? go1.4/doc/go_faq.html : We considered using LLVM for gc but we felt it was too large and slow to meet our performance goals. On Wednesday, December 13, 2017

[go-nuts] Re: Toward a capabilities-based security model for Golang

2017-12-15 Thread Jae Kwon
I'll follow the procedure here tomorrow: https://github.com/golang/proposal Meanwhile, any feedback appreciated! -- 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

[go-nuts] Toward a capabilities-based security model for Golang

2017-12-15 Thread jae
This proposal is a combination of two proposals to evolve Golang towards a capabilties-based language. 1. Modify the const keyword to allow holding mutable (and new immutable) types. 2. Implement faster immutable struct assignment. In Rust, immutability is deep, so you can't modify

Re: [go-nuts] How to get nice html from godoc?

2017-12-15 Thread Justin Israel
On Fri, Dec 15, 2017, 7:35 AM wrote: > I run godoc like this: > > *godoc -html jake\tmp > doc.html* > > When I open the resulting file (in Chrome or Firefox) the result look > terrible. The resulting file is attached. The collapsible sections display > as two separate items,

[go-nuts] Re: go and cygwin!

2017-12-15 Thread Volker Dobler
On Friday, 15 December 2017 20:24:25 UTC+1, Frank Davidson wrote: > > I'm having trouble with go get and cygwin. I get a bad directory: > > [...] > fatal: Invalid path > '/home/davidfr/gocode/C:\cygwin\home\davidfr\gocode\src\golang.org\x\tools': > No such file or directory > [...] > > Anyone

Re: [go-nuts] Re: Mapping C pointer to BYTE to golang []byte

2017-12-15 Thread 'Bryan C. Mills' via golang-nuts
You can ignore the vet warning if you are certain that the uintptr values you are converting to unsafe.Pointer are *valid pointers* (i.e., not non-pointer sentinel values) that point *outside the Go heap*. It sounds like that is probably the case, but you might want to check with someone more

Re: [go-nuts] Calling the Go compiler inside of tests

2017-12-15 Thread Glen Newton
YES! This looks like it is exactly what I needed! Thanks! Glen On Friday, December 15, 2017 at 3:55:51 PM UTC-5, Ian Cottrell wrote: > > You could just use the go/types package to typecheck the result instead of > compiling it, depending on exactly what you want to check that may be > enough.

Re: [go-nuts] How can I get unix timestamp(time.Now().Unix()) in linker(cmd/link)

2017-12-15 Thread Ian Lance Taylor
On Fri, Dec 15, 2017 at 3:08 AM, Ally Dale wrote: > Hi all, > I just need a function to report the timestamp when my app compiled. > > func main() { > > > unix := runtime.BuildTimestamp() > > > t := time.Unix(unix, 0) > > > println("hello world") > > >

Re: [go-nuts] Calling the Go compiler inside of tests

2017-12-15 Thread 'Ian Cottrell' via golang-nuts
You could just use the go/types package to typecheck the result instead of compiling it, depending on exactly what you want to check that may be enough. On Fri, Dec 15, 2017 at 8:37 AM Tamás Gulácsi wrote: > When you invoke "go test", it compiles a test binary and calls

Re: [go-nuts] Re: Mapping C pointer to BYTE to golang []byte

2017-12-15 Thread snmed
Sorry if I wasn't clear about that, I calling CertFindCertificateInStore which according to MSDN returns a pointer to a struct of type PCCERT_CONTEXT and must be freed with CertFreeCertificateContext

[go-nuts] Re: net/mail: AddressList

2017-12-15 Thread David Lyons
Not sure it is broken, are you using the correct quotes? Building from the example on ParseAddressList, which uses the same underlying mechanics as addresslist (https://golang.org/pkg/net/mail/#example_ParseAddressList): Playground: https://play.golang.org/p/iV1EJ9w4FJ It appears to parse

[go-nuts] Re: go and cygwin!

2017-12-15 Thread Frank Davidson
I'm having trouble with go get and cygwin. I get a bad directory: davidfr@mybox ~/gocode $ go get golang.org/x/tools/cmd/... # cd .; git clone https://go.googlesource.com/tools C:\cygwin\home\davidfr\gocode\src\golang.org\x\tools Cloning into

Re: [go-nuts] XML Pretty Print

2017-12-15 Thread Hugh S. Myers
Has anyone tried HTML Tidy? I know it Pretty-prints HTML and I remember that the same is claimed for XML?… On Fri, Dec 15, 2017 at 10:27 AM, Mandolyte wrote: > I was able to do a minimalist pretty print with limitations just using > marshal/unmarshal. See the code here >

[go-nuts] static analysis tool for detecting unclosed io.Closer's

2017-12-15 Thread Brian Sorahan
I'm thinking something like what I described in the subject line could be useful. Does anyone know if there is one out there? I haven't been able to find one. Thank you! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] Re: Use golang to call the win API

2017-12-15 Thread jake6502
I have not called a Windows API from go before, so there may be other problems with your code. But looking at WlanEnumInterfaces documentation the last parameter is *not *a pointer to a pointer to a

Re: [go-nuts] XML Pretty Print

2017-12-15 Thread Mandolyte
I was able to do a minimalist pretty print with limitations just using marshal/unmarshal. See the code here under the "identityXform" folder. There is a "readme" in that folder with some notes on this. Also tried my hand at blogging about my findings

[go-nuts] [Looking for reviews] ff - server side framework

2017-12-15 Thread Michał Korman
Hi everyone, TLDR: I'm looking for your suggestions and opinions about the framework I've been working on recently - https://github.com/mkorman9/ff First of all, I'm relatively new to Go, but have a strong Java background. Despite the facts I love Go and I'm really amazed by its vast amount of

[go-nuts] Implementing SPOP from haproxy

2017-12-15 Thread google
Hi all. I want to implement the SPOProtocol from haproxy. This is a binary protocol defined in http://www.haproxy.org/download/1.8/doc/SPOE.txt Due to the fact that I'm new to golang I would like to here some experts opinions about my plan. I would like to use

[go-nuts] export json.Decoder offset method?

2017-12-15 Thread michael . m . spiegel
Hi folks, I was wondering if there is support for exporting the offset method of the encoding/json Decoder? The offset would be useful in cases where an error is reported during decoding. The json.SyntaxError and json.UnmarshalTypeError types export an Offset field but for other error types

Re: [go-nuts] Re: Mapping C pointer to BYTE to golang []byte

2017-12-15 Thread 'Bryan C. Mills' via golang-nuts
You haven't actually said which system call you're invoking, but from the name CERT_CONTEXT and the layout of the struct I'm guessing it's probably CertCreateCertificateContext or CertEnumCertificatesInStore

Re: [go-nuts] Re: Storing types in a map[string]type ?

2017-12-15 Thread Sebastien Binet
On Fri, Dec 15, 2017 at 5:20 PM, jakdept wrote: > So, I've thought about this further - if I don't bother with the > interfaces, I can make this simpler. I can convert between with just > v1csv(object) just fine. And that . should work because it'll only be used > in a client,

[go-nuts] Re: Storing types in a map[string]type ?

2017-12-15 Thread jakdept
So, I've thought about this further - if I don't bother with the interfaces, I can make this simpler. I can convert between with just v1csv(object) just fine. And that . should work because it'll only be used in a client, and it should still be extendable. It would still be nice to store those

[go-nuts] Re: Storing types in a map[string]type ?

2017-12-15 Thread C Banning
You can certainly do what, I think, you're wanting to do. "var versions map[string]Version" is valid. You probably want a package entry point something like "GetVersion(s string) *Version" to select the one you want to use in your mainline. (Note: each Version can use a unique struct if

[go-nuts] Calling the Go compiler inside of tests

2017-12-15 Thread Tamás Gulácsi
When you invoke "go test", it compiles a test binary and calls that. Why can't you just repeat that? -- 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

[go-nuts] Calling the Go compiler inside of tests

2017-12-15 Thread Glen Newton
Hello, Apologies if this has already been discussed. I have a go tool (chidley - https://github.com/gnewton/chidley) that converts xml to Go struct code by examining a sample file (perhaps very large) of the XML (It can also generate Java JAXB code...). Production examples of generated

[go-nuts] How can I get unix timestamp(time.Now().Unix()) in linker(cmd/link)

2017-12-15 Thread Ally Dale
Hi all, I just need a function to report the timestamp when my app compiled. func main() { unix := runtime.BuildTimestamp() t := time.Unix(unix, 0) println("hello world") println("buildtimestamp:", unix) println("buildtime :", t.String())