[go-nuts] Anyone aware of a CVSS v3 parser & score computation library?

2016-07-25 Thread 'Eric Johnson' via golang-nuts
go-search.org and Google just found CVSS v2 implementations. Anyone have any tips? Eric. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [go-nuts] Re: [ANN] UniDoc PDF Toolkit for golang

2016-07-18 Thread 'Eric Johnson' via golang-nuts
On Monday, July 18, 2016 at 4:45:37 AM UTC-7, rog wrote: > > On 16 July 2016 at 16:33, Daniel Theophanes > wrote: > > I would also note that AGPL is probably unusable in most Go programs > > (statically linked and all). -Daniel > > Why so? You just need to make your

[go-nuts] Re: Should a program always exit in main()?

2017-02-08 Thread 'Eric Johnson' via golang-nuts
On Tuesday, February 7, 2017 at 3:12:13 PM UTC-8, Francis Chuang wrote: > > I am working on a client library that starts a Kafka consumer to listen > for messages from a kafka stream and run some user defined handlers.* I > want the design to be "crash-only" as much as possible*, so will be >

[go-nuts] Re: defer at struct level

2016-08-21 Thread 'Eric Johnson' via golang-nuts
On Sunday, August 21, 2016 at 3:04:02 PM UTC-7, Asit Dhal wrote: > > Hi all, > I use defer to release resource at function level. > > func test() { > a := A.Open() > defer a.Close() > //other code > } > > I need the object a, to be wrapped in a struct. Can someone tell me how to > make

[go-nuts] In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-29 Thread 'Eric Johnson' via golang-nuts
Not that I think these account for much, but sort of fun to point at: https://benchmarksgame.alioth.debian.org/u64q/go.html (Short summary - now with Go 1.7, Go is faster for most benchmarks.) And then, for language adoption, the TIOBE language index for August of 2016:

Re: [go-nuts] In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-29 Thread 'Eric Johnson' via golang-nuts
wrote: > On Mon, Aug 29, 2016 at 4:51 PM, 'Eric Johnson' via golang-nuts > <golang-nuts@googlegroups.com> wrote: > > > > And then, for language adoption, the TIOBE language index for August of > > 2016: > > http://www.tiobe.com/tiobe-index/ > > >

Re: [go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-30 Thread 'Eric Johnson' via golang-nuts
I looked at the k-nucleotide program, and was unable to figure out a way to make it faster. Most of the time appears to be spent on this one line: pointer, ok := counts[key] pprof reports: 19080ms 56.50% 56.50%22100ms 65.44% runtime.mapaccess2_fast64 This is, of course, exactly

[go-nuts] Re: Licenses

2016-09-29 Thread 'Eric Johnson' via golang-nuts
On Thursday, September 29, 2016 at 1:12:41 AM UTC-7, dja...@gmail.com wrote: > > Hi, > May be OT, but: > > Can i translate some GPLv2 licensed C code to GO, and publish it under > BSD new license ? > Code comments are from original C code. > The correct way to do this would be to perform a

[go-nuts] Mocking os.Open and related calls for more code coverage

2016-09-28 Thread 'Eric Johnson' via golang-nuts
Why not, instead of passing a file path as a parameter, pass a function that returns a ReadCloser (and error, of course). That way, you can preserve the existing semantics of your function, but move the decision of what to open, how to open, and how to handle the error for when it fails - all

[go-nuts] Re: Beautify XML

2016-11-07 Thread 'Eric Johnson' via golang-nuts
On Friday, November 4, 2016 at 2:32:24 PM UTC-7, Tong Sun wrote: > > How to beautify a given XML string in GO? > As someone who has spent a fair amount of time in the complexities of XML, it is worth noting that XML is not equivalent to JSON in the context of your question. Only with a

[go-nuts] Re: With GO - Can I say Procedural is better than OO?

2016-11-07 Thread 'Eric Johnson' via golang-nuts
On Saturday, September 24, 2011 at 9:14:22 AM UTC-7, nvcnvn wrote: > > I just read here: > http://golang.org/doc/go_faq.html#Is_Go_an_object-oriented_language > And all of the GO example we have is not writen in OOP way. > So can I say that GO see the benefit of Procedural over OO!? >

[go-nuts] Re: package versioning

2016-10-11 Thread 'Eric Johnson' via golang-nuts
On Tuesday, October 11, 2016 at 5:55:23 AM UTC-7, Peter Vypov wrote: > > This question has been asked here a number of times, but the last time a > few months ago: are there any plans to add support for package versioning > (understanding VCS tags in the import paths), that is to teach `go get`

Re: [go-nuts] Re: package versioning

2016-10-13 Thread 'Eric Johnson' via golang-nuts
On 10/12/16 2:32 AM, Peter Vypov wrote: On Wednesday, October 12, 2016 at 2:04:19 AM UTC+2, Eric Johnson wrote: My view is that the general case requires putting such metadata in a separate file for a package. Yes, I agree with you that having multiple Go files with such comments

Re: [go-nuts] Re: How has your company adopted Go ?

2017-01-03 Thread 'Eric Johnson' via golang-nuts
> On Jan 3, 2017, at 8:47 AM, Haddock wrote: > > I large organization where Java JEE architects are around bringing Go into > the game is almost impossible. Many architects have build up their careers on > application servers and EJBs without really understanding what that big

Re: [go-nuts] Re: How has your company adopted Go ?

2016-12-29 Thread 'Eric Johnson' via golang-nuts
Stand-alone services are definitely the way to go. Pick a small service that either is yet to be written, or is performing badly in its current Java implementation. Eric On Dec 29, 2016, at 12:35 AM, Haddock wrote: This thread is very interesting to me as I'm working

[go-nuts] Re: How has your company adopted Go ?

2016-12-20 Thread 'Eric Johnson' via golang-nuts
On Monday, December 19, 2016 at 5:03:43 AM UTC-8, Tieson Molly wrote: > > What arguments or factors have contributed to your company adopting Go? > My company does enough different kinds of work that the question is too broad. To some, "adoption" might imply broad usage. In practice, usage

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-04-03 Thread 'Eric Johnson' via golang-nuts
My 2 cents: On Saturday, April 1, 2017 at 4:26:20 AM UTC-7, Axel Wagner wrote: > > Ian: > Re your question: See my example given above (or the one below, which is > probably more authentic). For example, you might be allocating the returned > struct, and piece by piece filling in the fields. If

[go-nuts] Introspecting a built Go application - how?

2017-04-21 Thread 'Eric Johnson' via golang-nuts
A question has been bugging me for the past few weeks. How can I tell what was used to build a Go application? As I see various security notices scrolling by my email inbox, I see things like Tomcat or OpenSSL announcing security updates, the JRE, or for that matter, Go itself. Once I see

[go-nuts] Re: the case for returning interface vs struct

2017-03-02 Thread 'Eric Johnson' via golang-nuts
Structs give the caller so many immediate benefits: - If there's internal state that clients shouldn't muck around with, then (a) keep a field private, or (b) keep a field private and make it a pointer to state (such as mutexes). - Structs can be copied directly. - Set and get

[go-nuts] Go 2 suggestion - what dependencies included in a build?

2017-08-15 Thread 'Eric Johnson' via golang-nuts
As I scan reports of vulnerable software, I'm concerned that it is impossible to tell, from a Go binary, what was used to build that binary. Which means that if I depend on some library that is discovered to have a vulnerability, I cannot look at each of the binaries I have deployed, and

[go-nuts] Re: defer func() { _ = resp.Body.Close() }()

2017-08-17 Thread 'Eric Johnson' via golang-nuts
For the truly paranoid, perhaps write a helper function "EnsureClosed()" or something like that, which will do the close, but perhaps also appropriately log a failure to close. On Wednesday, August 16, 2017 at 5:05:39 AM UTC-7, Gert wrote: > > To pass errcheck I need to do something like > >

[go-nuts] Re: Are functional options idiomatic

2017-07-10 Thread 'Eric Johnson' via golang-nuts
On Sunday, July 9, 2017 at 9:12:06 PM UTC+2, Anmol Sethi wrote: > > Hello everyone! > > I’m writing a new library where I need to be able to configure a struct. > This struct and its configuration will be accessed concurrently. One design > pattern I see throughout the standard library and

[go-nuts] Re: "interface{} says nothing", lets consider it destroys information

2017-07-20 Thread 'Eric Johnson' via golang-nuts
Again, I'm mostly for generics being added to Go, because I've found occasion where they would be useful... On Thursday, July 20, 2017 at 6:40:00 AM UTC-7, M P r a d e s wrote: > > Go could have least have parametric functions (ex : > > func Foo(value T)T { /.../ } > > bar := Foo(3) //types are

Re: [go-nuts] No Allman-Style, No go!

2017-07-24 Thread 'Eric Johnson' via golang-nuts
On Saturday, September 21, 2013 at 7:04:09 AM UTC-7, Michael Daconta wrote: > > As you can see, the code has semi-colons in each required location. So, I > ask you - why is the above code illegal? > Why is breaking the speed limit illegal? On many roads, it is set arbitrarily low because

[go-nuts] Re: "interface{} says nothing", lets consider it destroys information

2017-07-19 Thread 'Eric Johnson' via golang-nuts
While I lean towards the view that Go should add support for type generics, I'm not sure your example actually provides sufficient detail to be an argument for them. On Monday, July 17, 2017 at 2:07:46 AM UTC-7, mhh...@gmail.com wrote: > > in func do(i interface{}) interface{} (return i), do

Re: [go-nuts] Go 2 suggestion - what dependencies included in a build?

2017-08-16 Thread 'Eric Johnson' via golang-nuts
2017 at 9:10 AM, Lars Seipel <lars.sei...@gmail.com> wrote: > On Tue, Aug 15, 2017 at 04:58:00PM -0700, 'Eric Johnson' via golang-nuts > wrote: > > As I scan reports of vulnerable software, I'm concerned that it is > > impossible to tell, from a Go binary, what was us

Re: [go-nuts] Go 2 suggestion - what dependencies included in a build?

2017-08-17 Thread 'Eric Johnson' via golang-nuts
*may* > have a Gopkg.lock (if everyone uses dep) but not much else. They may be > Debian and build from source packages where the Go compiler sees no version > info at all - but the package manager knows the information you want. Etc. > > //jb > > On 16 Aug 2017, at 20:11, 'Eric Jo

[go-nuts] Re: Is it ok to separate Open and Close logic?

2017-05-15 Thread 'Eric Johnson' via golang-nuts
In this kind of scenario, I recommend a (type) wrapper for *File Rework the code as: type Doer *File func NewDoer(f string) (Doer, err) { file, err := os.Open(f) // ... } func (d Doer) Close() error { return d.Close() } Everything else being the same, your caller can then expect

[go-nuts] Re: Handling errors in functions

2017-06-21 Thread 'Eric Johnson' via golang-nuts
My take is something like the following would be more idiomatic // SummonerByName returns profile address and an error. We need it in case where // we cannot get the profile for some reason func SummonerByName(name string, server string) (*SummonerProfile, error) { var resp, err =

[go-nuts] Re: Runtime code generation?

2017-05-19 Thread 'Eric Johnson' via golang-nuts
Indeed. This is the same answer I was going to give. Run-time code generation implies a whole bunch of different scenarios with a whole bunch of use-cases. There are resource sharing concerns, security concerns, and performance concerns that need to be nailed down. Otherwise it is difficult to

[go-nuts] "Selling" Go to Management

2017-05-01 Thread 'Eric Johnson' via golang-nuts
Just answered a question on Quora today that might be helpful: https://www.quora.com/Why-would-anyone-program-in-Go/answer/Eric-Johnson-157?share=ca0e6b40=zEgo -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

[go-nuts] Re: [urgent] need aguments to justify use of Go for a scientific application

2017-12-07 Thread 'Eric Johnson' via golang-nuts
One last bit of perspective here, which may be relevant to your project? I've found that Go has the lowest cognitive load "switching" load. I have a job that mostly doesn't involve coding. When I get to code, I have a limited window in which I can jump in and make changes. Amongst the

[go-nuts] Re: Printfln on fmt and log

2018-05-24 Thread 'Eric Johnson' via golang-nuts
Hi Anirudh, On Tuesday, May 22, 2018 at 4:29:59 PM UTC-7, Anirudh Vyas wrote: > > Hi - > > I want to have a Printfln on log and fmt - Currently I use fmt.Printf( " > yada yada \n", some_yada_yada) to achieve same effect. Is there a plan to > add this simple yet extremely useful function? > I

[go-nuts] Is it possible to launch a Meltdown or Spectre attack with Go code?

2018-01-04 Thread 'Eric Johnson' via golang-nuts
Anyone have any insight into whether it is possible to launch a Meltdown or Spectre attack using Go code? Go's general practice of preventing access beyond slice limits, and its habit of zeroing memory makes me think triggering a Spectre or Meltdown attack with Go code is very unlikely. On

[go-nuts] interaction of defer and named returns is too subtle and non-local

2018-01-10 Thread 'Eric Johnson' via golang-nuts
I was looking at fixing an issue flagged by gometalinter, and realized I didn't understand the actual behavior of defer statements. Specifically, I was not handling the error return of a close operation. I wrote a test program so I could understand the behavior, which led to these two function

[go-nuts] Re: “Design Patterns: Elements of Reusable Object-Oriented Software” in Go

2018-02-05 Thread 'Eric Johnson' via golang-nuts
An interesting idea. Some thoughts On Friday, February 2, 2018 at 9:03:54 AM UTC-8, matthe...@gmail.com wrote: > > I’m looking at patterns summarized on Wikipedia from “Design Patterns: > Elements of Reusable Object-Oriented Software” and writing out a few as the > equivalent in Go. > >

[go-nuts] The generics draft proposal underspecifies contracts

2018-09-10 Thread 'Eric Johnson' via golang-nuts
Two thoughts about the contracts proposal: - In the proposal a contract is loosely defined as the resulting implications from a function. In the interests of starting a discussion, it seems like a great starting place. However, it feels like it would be useful to spell it out in

[go-nuts] Re: Language is a platform, which golang still does not pay attention to !!!

2018-04-05 Thread 'Eric Johnson' via golang-nuts
I have a different perspective On Thursday, April 5, 2018 at 10:26:19 AM UTC-7, bingj...@gmail.com wrote: > > Almost 10 years golang appears in the world. 10 years is not a short > duration. I think if it is not popular until 2020, it will never be popular. > > Golang is designed for cloud and

Re: [go-nuts] Go language should become an ANSI and ISO standard.

2018-10-12 Thread 'Eric Johnson' via golang-nuts
Is an alternate solution to use Go as a source language, then translate to an allegedly "ISO" language? Eric. On Thursday, October 11, 2018 at 8:57:39 PM UTC-7, Beoran wrote: > > So no matter if I say yes or no, both ways are bad? I think is not a very > fair way to argue. > > Anyway, with the

Re: [go-nuts] Re: Best way to handle database transactions? (commit, or rollback on error)

2018-12-07 Thread 'Eric Johnson' via golang-nuts
; On Thu, 6 Dec 2018, 10:26 pm Eric Johnson >> >> >> On Thu, Dec 6, 2018 at 12:16 AM roger peppe wrote: >> >>> >>> >>> On Wed, 5 Dec 2018 at 18:55, 'Eric Johnson' via golang-nuts < >>> golang-nuts@googlegroups.com> wrote: >>> &

Re: [go-nuts] Re: Best way to handle database transactions? (commit, or rollback on error)

2018-12-06 Thread 'Eric Johnson' via golang-nuts
On Thu, Dec 6, 2018 at 12:16 AM roger peppe wrote: > > > On Wed, 5 Dec 2018 at 18:55, 'Eric Johnson' via golang-nuts < > golang-nuts@googlegroups.com> wrote: > >> I always go with the approach that uses the equivalent of the >> "Transact()" method. >

[go-nuts] Re: Best way to handle database transactions? (commit, or rollback on error)

2018-12-05 Thread 'Eric Johnson' via golang-nuts
I always go with the approach that uses the equivalent of the "Transact()" method. On top of that, rather than use a generic *sql.Tx parameter to the "txFunc" function, I pass an interface that is specific to the operations of the database layer for my application. This pattern has three

[go-nuts] Re: I am not in favor of generics.

2018-09-17 Thread 'Eric Johnson' via golang-nuts
On Monday, September 17, 2018 at 9:04:26 AM UTC-7, jucie@zanthus.com.br wrote: > > Go core team is working hard to bring generics to the language because > several people asked for it. With all due respect for those users and for > people working hard to make generics a reality, I feel

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-18 Thread 'Eric Johnson' via golang-nuts
On Tue, Sep 18, 2018 at 6:21 AM Robert Engels wrote: > I am going to refer everyone involved in this discussion on generics to > this once again. I know it is long, read the summary... but it’s important: > > > https://www.researchgate.net/publication/236644412_Adoption_and_Use_of_Java_Generics

[go-nuts] Re: Open Source audit of go package dependencies for security vulnerabilities?

2019-08-13 Thread 'Eric Johnson' via golang-nuts
It would be great to hear of an answer to this question. I suspect there isn't one, though. The trouble is, one of the first hurdles is to identify Go libraries that have CVEs against them. It is very easy to find CVEs for the Go standard library, but I cannot see any easy way to scan the

[go-nuts] Re: Open Source audit of go package dependencies for security vulnerabilities?

2019-08-13 Thread 'Eric Johnson' via golang-nuts
And then, it also occurs to me that perhaps I can answer my own question. Taking advantage of three aspects of the ecosystem. #1) Most open source Go libraries are on GitHub #2) Many (most?) CVEs for open source projects will include a reference back to the project, and these references can be

[go-nuts] Re: golang with XSLT

2019-08-19 Thread 'Eric Johnson' via golang-nuts
Tips: - When ever you're wondering about a good library for , two good places to start are https://go-search.org , and https://github.com/avelino/awesome-go. - As an alternative to finding a Go implementation, reuse an existing one (libxslt) by calling out to C code. It may