[go-nuts] Help getting XML-RPC and reflection based code to work

2018-11-09 Thread David Luu
I thought I posted this before, but maybe I didn't, or it got removed. A 
cross-post from Golang Bridge forum

Was wondering if go users can help me fix up and improve the current code I 
have and look into 2 issues I filed against the library I use. Any 
help/insights appreciated.

https://github.com/daluu/gorrs

particularly

https://github.com/divan/gorilla-xmlrpc/issues/16

https://github.com/divan/gorilla-xmlrpc/issues/18

all this is for a go version of Robot Framework’s remote library server 
interface, which no one has done before when I last checked.

-- 
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] go modules and gocode

2018-11-09 Thread Tyler Compton
My understanding is the mdempsky branch is not expected to work with Go
modules. This fork apparently will: https://github.com/stamblerre/gocode

That said, I haven't personally had any luck with that fork either. I would
love to hear from someone who's had success with gocode/vim-go/modules.

On Fri, Nov 9, 2018 at 1:03 PM Keith Brown  wrote:

> Using vim-go
>
> Has anyone gotten gocode (https://github.com/mdempsky/gocode) to work
> with golang modules?
>
> In my GOPATH directory, i see
>
> gopath
>   pkg
> mod
>  cache
>download
>  github.com
>
> But for whatever reason, its not autocompletting the modules.
>
> Is there anything else I should be doing? In addion, is there a better
> solution for vim users?
>
>
> --
> 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] Why fmt.Print() debug statements aren't showing up in dev_appserver.py logs?

2018-11-09 Thread Tyler Compton
App Engine's logging library requires a context object as its first
argument, so I'm not sure which log package you're using right now. The
correct way to use the App Engine logging library is to create a context
somewhere early on in the request's life-cycle and use it as the first
argument to the log functions.

ctx := appengine.NewContext(r)  // Where r is your *http.Request object
log.Infof(ctx, " handleMain() called")

Let me know what behavior you see doing this.

On Fri, Nov 9, 2018 at 1:15 PM Bryan  wrote:

> I replaced the fmt.Print statement  with:
>
> log.Infof(" handleMain() called")
>
> The local server still serves the page correctly but the log Info is not
> showing up in the dev_appserver.py logs in Terminal.
>
> On Thursday, November 8, 2018 at 5:57:06 PM UTC-5, Tyler Compton wrote:
>
>> I believe that the most correct way to do logging with App Engine is to
>> use the log package (https://godoc.org/google.golang.org/appengine/log).
>> This, to my understanding, allows App Engine to categorize logs based on
>> which request they are from alongside some other metadata. Do you see
>> printouts using this package?
>>
>> On Thu, Nov 8, 2018 at 1:02 PM Bryan  wrote:
>>
> The local webserver renders the page correctly at http://localhost:8080/
>>>
>>> I"m using the code from
>>> https://github.com/GoogleCloudPlatform/golang-samples/tree/master/appengine/helloworld
>>>
>>> I put a print statement at line 20 of hello.go :
>>>
>>> fmt.Print(" hello.handle() called")
>>>
>>> I'm starting the local server with:
>>>
>>> $ dev_appserver.py app.yaml
>>>
>>> Shouldn't the print statement be showing up in the osX Terminal window
>>> server logs?
>>>
>>> I could have sworn I was not having this issue a few weeks ago. How do I
>>> check that the wrapper is capable of processing STDOUT?
>>>
>>> How do I fix 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...@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.


Re: [go-nuts] Why fmt.Print() debug statements aren't showing up in dev_appserver.py logs?

2018-11-09 Thread Bryan
I replaced the fmt.Print statement  with:  

log.Infof(" handleMain() called")

The local server still serves the page correctly but the log Info is not 
showing up in the dev_appserver.py logs in Terminal.

On Thursday, November 8, 2018 at 5:57:06 PM UTC-5, Tyler Compton wrote:
>
> I believe that the most correct way to do logging with App Engine is to 
> use the log package (https://godoc.org/google.golang.org/appengine/log). 
> This, to my understanding, allows App Engine to categorize logs based on 
> which request they are from alongside some other metadata. Do you see 
> printouts using this package?
>
> On Thu, Nov 8, 2018 at 1:02 PM Bryan > 
> wrote:
>
>> The local webserver renders the page correctly at http://localhost:8080/
>>
>> I"m using the code from 
>> https://github.com/GoogleCloudPlatform/golang-samples/tree/master/appengine/helloworld
>>
>> I put a print statement at line 20 of hello.go :   
>>
>> fmt.Print(" hello.handle() called")
>> 
>> I'm starting the local server with:   
>>
>> $ dev_appserver.py app.yaml
>> 
>> Shouldn't the print statement be showing up in the osX Terminal window 
>> server logs?
>>
>> I could have sworn I was not having this issue a few weeks ago. How do I 
>> check that the wrapper is capable of processing STDOUT?
>>
>> How do I fix 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...@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] go modules and gocode

2018-11-09 Thread Keith Brown
Using vim-go

Has anyone gotten gocode (https://github.com/mdempsky/gocode) to work with 
golang modules? 

In my GOPATH directory, i see

gopath
  pkg
mod
 cache
   download
 github.com

But for whatever reason, its not autocompletting the modules.

Is there anything else I should be doing? In addion, is there a better 
solution for vim users? 


-- 
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] require statements in multi module repositories

2018-11-09 Thread 'Jean de Klerk' via golang-nuts
Thanks a million Paul. Yes, they were resolved (for posterity, in
https://github.com/golang/go/issues/28685).

On Fri, Nov 9, 2018 at 10:11 AM, Paul Jolly  wrote:

> > I've played around with go modules in a multi module repository, and I'm
> running into oddities. The main confusion is that I have this idea that any
> package (and its subpackages) that has a go.mod file is a distinct, carved
> out module that has no relation to its siblings and parent, even if they
> happen to reside in the same repository and have their own go.mod files.
> That does not seem to be the case, though.
>
> You are correct. Locally, there are no constraints on the
> containment/nesting of modules. That is to say, a module that exists
> in a sub directory of another module does not need to share the same
> path prefix.
>
> In a remote VCS however, the containment is important if that VCS is
> used as part of resolving a (custom) import path, and the go tool will
> fail resolution if it not correct.
>
> > Questions:
> >
> > If pkg_a depends on pkg_b, I expect the go.mod in pkg_a to contain
> "require github.com/jadekler/module-testing/pkg_b". This does not happen
> when I `go mod init && go mod tidy`. Is that WAI? Why?
> > If pkg_c depends on the parent module, I expect the go.mod in pkg_c to
> contain "require github.com/jadekler/module-testing". This does not
> happen when I `go mod init && go mod tidy`. Is that WAI? Why?
>
> I think these questions are answered in the GitHub issue you raised?
>
> Please say if not.
>
> Thanks,
>
>
> Paul
>

-- 
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] require statements in multi module repositories

2018-11-09 Thread Paul Jolly
> I've played around with go modules in a multi module repository, and I'm 
> running into oddities. The main confusion is that I have this idea that any 
> package (and its subpackages) that has a go.mod file is a distinct, carved 
> out module that has no relation to its siblings and parent, even if they 
> happen to reside in the same repository and have their own go.mod files. That 
> does not seem to be the case, though.

You are correct. Locally, there are no constraints on the
containment/nesting of modules. That is to say, a module that exists
in a sub directory of another module does not need to share the same
path prefix.

In a remote VCS however, the containment is important if that VCS is
used as part of resolving a (custom) import path, and the go tool will
fail resolution if it not correct.

> Questions:
>
> If pkg_a depends on pkg_b, I expect the go.mod in pkg_a to contain "require 
> github.com/jadekler/module-testing/pkg_b". This does not happen when I `go 
> mod init && go mod tidy`. Is that WAI? Why?
> If pkg_c depends on the parent module, I expect the go.mod in pkg_c to 
> contain "require github.com/jadekler/module-testing". This does not happen 
> when I `go mod init && go mod tidy`. Is that WAI? Why?

I think these questions are answered in the GitHub issue you raised?

Please say if not.

Thanks,


Paul

-- 
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] front-end post a body, back-end use gin.Context BindJSON but fail

2018-11-09 Thread Burak Serdar
On Fri, Nov 9, 2018 at 6:35 AM  wrote:
>
> front-end info
> //body struct
> type Bucket struct {
>Name  string  `json:"name"`
>KeyId string  `json:"key_id"`
>KeySecret string  `json:"key_secret"`
>Header*Header `json:"header"`
>Property  int `json:"property"`
> }
>
> type Header struct {
>CacheControl int64 `json:"cache_control"`
> }
> //my post request body
> {"name":"g","key_id":"221bce6492eba70f","key_secret":"6eb80603e85842542f9736eb13b7e3","header":{"cache_control":"10"},"property":"0"}

"cache_control":"10" is a string. If you want to unmarshal an int,
this should've been "cache_control":10 (without the quotes)

Or, change the Header.CacheControl to string.

>
> Name
> front-end
> back-end error when do 
> /usr/local/Cellar/go/1.10.3/libexec/src/encoding/json/decode.go:171 
> cache_control is string not int
>
>
>
>
>
> --
> 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] Re: Reading Windows event logs

2018-11-09 Thread Samet Sazak
By the way, I found this repository which is solved my problem :

https://github.com/0xrawsec/golang-evtx

Regards,

On 7 Nov 2018 Wed at 19:18 Samet Sazak  wrote:

> Thank you so much, I will ask to him.
>
> On 7 Nov 2018 Wed at 18:57 Robert Engels  wrote:
>
>> I was referring to it because it lays out how to write the code to do it,
>> or it appears the original poster has probably already written the code.
>> WMI is a pain, lots of parsing.
>>
>> On Nov 7, 2018, at 9:51 AM, Samet Sazak  wrote:
>>
>> Thank you for quick reply but it’s not related. I found elastic/beats
>> using eventlog package but still didn’t solve the problem:)
>>
>> I will try WMI queries to get event logs.
>>
>> Thanks,
>>
>> On 7 Nov 2018 Wed at 18:03 Robert Engels  wrote:
>>
>>> Btw I know it is the beginning of the thread, but if you read through
>>> it, you will see what or how to do it.
>>>
>>> On Nov 7, 2018, at 8:59 AM, Robert Engels  wrote:
>>>
>>> Maybe this...
>>> https://grokbase.com/t/gg/golang-nuts/156jvs0e0p/go-nuts-reading-windows-event-logs
>>>
>>> On Nov 7, 2018, at 7:42 AM, smt...@gmail.com wrote:
>>>
>>>
>>> Yes, anyone ?
>>>
>>> 13 Ocak 2016 Çarşamba 15:35:33 UTC+2 tarihinde Durgababu Neelam yazdı:

 Hi,

 can any one provide the code to read/query event logs in golang?

 thanks

 On Sunday, June 21, 2015 at 2:38:44 PM UTC+5:30, brainman wrote:
>
> On Saturday, 20 June 2015 18:49:29 UTC+10, pmo...@mozilla.com wrote:
> > ... would it be possible to parse these to auto-generate a complete
> set of syscalls in syscall_windows.go (link in previous message)?
>
> Sure you could generate something like that. We used to do in runtime
> package - see defs_windows.go (it is not used at this moment) - for 
> Windows
> data types and consts. Unfortunately it is not very useful for API calls -
> these need to present Windows errors similar to other functions in Go. How
> do you propose to handle Windows errors?
>
> Alex
>
 --
>>> 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.
>>>
>>> --
>> Samet Sazak
>>
>> --
> Samet Sazak
>
> --
Samet Sazak

-- 
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.