[go-nuts] Re: Syscall trouble with parameter handling

2017-02-21 Thread snmed
okay it says "E_INVALIDARGOne or more arguments are not valid 0x80070057", but what i am doing wrong with the parameters? Am Dienstag, 21. Februar 2017 12:01:47 UTC+1 schrieb snmed: > > Ohh strange i missed that, i thought it's S_OK because the error stated > "

[go-nuts] Syscall trouble with parameter handling

2017-02-21 Thread snmed
r2, err) // output: // 0 // 2147942487 0 The operation completed successfully. unfortunately the call succeeds but the context is still zero. Probably i call the function with the wrong parameters but i can't work it out. Has anybody a idea what could be wrong? Thank you in advance snm

[go-nuts] Re: Syscall trouble with parameter handling

2017-02-21 Thread snmed
Ohh strange i missed that, i thought it's S_OK because the error stated "The operation completed successfully". So i need to find out why it is failling, do you have any idea about the reason? Cheers snmed Am Dienstag, 21. Februar 2017 11:16:08 UTC+1 schrieb brainman: >

[go-nuts] Re: Syscall trouble with parameter handling

2017-02-21 Thread snmed
Has anyone a hint, what i'm doing wrong with the Call arguments? I think the last parameter is the problematic one, but i can't figure out how to pass that argument. Any help would be most appreciated! Cheers snmed Am Dienstag, 21. Februar 2017 10:36:29 UTC+1 schrieb snmed: > > Hi all

[go-nuts] Re: Syscall trouble with parameter handling

2017-02-22 Thread snmed
Okay thanks anyway Am Mittwoch, 22. Februar 2017 11:51:45 UTC+1 schrieb brainman: > > > Has anyone a hint, what i'm doing wrong with the Call arguments? > > I do not know. Sorry. > > > I think the last parameter is the problematic one, ... > > It looks fine to me. > > Alex > -- You received

Re: [go-nuts] Re: Syscall trouble with parameter handling

2017-02-22 Thread snmed
Hi Konstantin Thanks a lot for your input. You were right about the second parameter and the call to ColInitalize, so now i'm a bit further but still get an error. I will have a closer look on that error and hope i find a solution for it. Cheers snmed Am Mittwoch, 22. Februar 2017 11:58:35 UTC

[go-nuts] Named or unnamed struct initialisation? What is best practice?

2017-07-04 Thread snmed
Hi gophers I've a litte question about best practice for struct initialisation. For example one can initialise structs like: type A struct { name string firstName string } a1 := A{"Mueller", "Max"} a2 := A{name: "Mueller", firstName: "Max"} The first one is concise and intuitive,

[go-nuts] Re: Named or unnamed struct initialisation? What is best practice?

2017-07-05 Thread snmed
Okay thanks, as I supposed. Personally i used always named initialisation despite of the overhead, but sometimes I feel the urge to use the short unamed initialisation. ;-) Am Mittwoch, 5. Juli 2017 07:41:04 UTC+2 schrieb Tamás Gulácsi: > > Named. -- You received this message because you are

[go-nuts] Re: Named or unnamed struct initialisation? What is best practice?

2017-07-05 Thread snmed
Hi rob Thanks for your response. I didn't know that trick, but it seems to me a little bit ugly to guard fields that way. I will stick to named initialisations and write it as a policy into the style guide. Cheers Am Donnerstag, 6. Juli 2017 02:26:27 UTC+2 schrieb rob rodgers: > > for some of

[go-nuts] Goroutines chan to get data at specific time

2017-08-06 Thread snmed
/doc/effective_go.html#channels documentation about channels. Cheers snmed -- 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-nut

[go-nuts] Go channels overused and hyped?

2017-08-08 Thread snmed
opers. Because I just used go for a couple of months for my private web projects and rarely get in touch with channels. By the way, that article is not a rant and the author likes go very much as far as I can conclude from the article. Cheers snmed -- You received this message because yo

[go-nuts] Re: Go channels overused and hyped?

2017-08-08 Thread snmed
pping on the > bandwagon, understand the trade-offs and pick the one that is most suitable > in a certain situation.* > > + Egon > > On Tuesday, 8 August 2017 09:01:12 UTC+3, snmed wrote: >> >> Hi Gophers >> >> I stumbled over a nice and very interesting Blo

[go-nuts] Re: Go channels overused and hyped?

2017-08-08 Thread snmed
snmed Am Dienstag, 8. August 2017 09:51:08 UTC+2 schrieb Dave Cheney: > > Everyone overused channels and goroutines at first. Why wouldn't you? > That's why you probably decided to try Go in the first place. > > I have a talk in Singapore a few months ago trying to explore this i

[go-nuts] gopherjs files, writing, loading

2017-08-04 Thread snmed
Hi "me" I don't know gopherjs well, but as far as I know, they only provide an api to the html 5 feature localStorage and sessionStorage, see https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage so you can't write directly to the filesystem with js via a browser. Ch

[go-nuts] Re: Goroutines chan to get data at specific time

2017-08-06 Thread snmed
understand your requirements: Here a working sequential solution: https://play.golang.org/p/2qohwIjP96 I hope that helps Cheers snmed Am Sonntag, 6. August 2017 13:05:11 UTC+2 schrieb Abhijit Desai: > > Requirement is to collect the data with in cuttoff time say 3 sec by > invoking web service

Re: [go-nuts] Go channels overused and hyped?

2017-08-18 Thread snmed
, right? Cheers snmed Am Samstag, 12. August 2017 23:37:45 UTC+2 schrieb Michael Jones: > > snmed, > > My disappointment with that blog post is that it does not address the > larger issue, which some people here have clarified, but to be clear on the > larger issue and the var

[go-nuts] Re: Released sting 1.0.0

2017-10-03 Thread snmed
Hi Egon Thank you very much for your feedback. You confirmed my assumption about di libraries in go and your links fortified this impression. Probably I have to rethink some old C# habits and map them to a more go idiomatic style. > It's difficult to evaluate the API because the examples

[go-nuts] Latest Tiobe Ranking

2017-10-09 Thread snmed
I've seen the latest Tiobe Index https://www.tiobe.com/tiobe-index/ How could that happen, dropped onto the 20th rank? Has someone a better source of go's adoption in the wild? Cheers -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Latest Tiobe Ranking

2017-10-09 Thread snmed
Hi Ian Thank you for your elaboration. I won't choose a language because of such index, but I'm trying to convince my colleagues of the benefits of go and therefore no matter how funny such indexes are, it isn't useful as well. I'm always looking for success stories about using go from other

Re: [go-nuts] Tools for 80 column split for golang

2017-09-07 Thread snmed
r: https://stackoverflow.com/questions/34846848/how-to-break-a-long-line-of-code-in-golang#answer-34848928 And here a simple example with fmt.Println: https://play.golang.org/p/tP8zkOo79l Cheers snmed Am Donnerstag, 7. September 2017 10:24:19 UTC+2 schrieb Sankar: > > Even with most mo

Re: [go-nuts] Re: error handling needs syntactical sugar

2017-09-07 Thread snmed
Hi Tim If you want halt the app, you should call panic, that's already a go built-in. Think it would apply to your proposal as well, despite i do not agree with it. Cheers snmed Am Donnerstag, 7. September 2017 14:42:12 UTC+2 schrieb Tim Uckun: > > >I *like* the way go does erro

[go-nuts] Re: Example output not visible in godoc

2017-09-25 Thread snmed
types in the examples. By the way i'm using go 1.9 on macOS, maybe someone can test if this behavior is the same for 1.8.3. Also i wondering if godoc.org is on version 1.9 or does it use an older version? Cheers Am Montag, 25. September 2017 10:54:57 UTC+2 schrieb snmed: > > Hi all >

[go-nuts] Released sting 1.0.0

2017-10-02 Thread snmed
Hi all I released my first open source go project: https://bitbucket.org/snmed/sting It's a simple DI library and is used for my own projects. I'm not sure how idomatic go it is, but I primarily started it to learn the go reflection package and capabilities. I'm sure there is still a lot

[go-nuts] Example output not visible in godoc

2017-09-25 Thread snmed
Hi all I have some problem with my go examples, in some case the output is correct rendered in a code block, but for other examples it is not rendered in a separat code block. Here the link to the documentation of my package: https://godoc.org/bitbucket.org/snmed/sting For example GetService

Re: [go-nuts] Example output not visible in godoc

2017-09-25 Thread snmed
Thank you for your answer, but nope doesn't make any difference, at least not with local godoc instance. Am Montag, 25. September 2017 11:03:55 UTC+2 schrieb Jan Mercl: > > On Mon, Sep 25, 2017 at 10:55 AM snmed <sandro@gmail.com > > wrote: > > > Has anyone an i

[go-nuts] Re: Should we stop using a global logger?

2017-08-25 Thread snmed
snmed -- 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] can list.List.Push* or Get return nil?

2017-08-28 Thread snmed
Hi As far as the docs are right: For Back: Back returns the last element of list l or nil. For PushBack: PushBack inserts a new element e with value v at the back of list l and returns e. So if you push nil, you get nil otherwise you get always your pushed element. Cheers -- You received

[go-nuts] Re: sync.Map for caching

2017-09-01 Thread snmed
but returns always the first stored item. Second example uses a lock to create and store the item. If the creator function is expensive, then I would use the latter example otherwise the first. Cheers snmed Am Freitag, 1. September 2017 00:18:35 UTC+2 schrieb bep: > > sync.Map in Go 1.9 is a

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

2017-12-14 Thread snmed
//golang.org/issue/13656#issuecomment-303216308 has a solution that > avoids copying and is more robust to large sizes. > > > On Thursday, December 14, 2017 at 5:27:57 AM UTC-5, snmed wrote: >> >> Okay I found a way, this seems to work: >> >> ca := (*[10

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] Mapping C pointer to BYTE to golang []byte

2017-12-13 Thread snmed
Hi all I'm trying to map a C structure to an equivalent go struct, but I bumped into a problem with a pointer to byte that is actually an array of bytes. Here is the C struct: typedef struct _CERT_CONTEXT { DWORD dwCertEncodingType; BYTE *pbCertEncoded; DWORD

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

2017-12-14 Thread snmed
mber 14, 2017 at 9:05:32 AM UTC+2, snmed wrote: >> >> Hi all >> >> I'm trying to map a C structure to an equivalent go struct, but I bumped >> into a problem with a pointer to byte that is actually an array of bytes. >> >> Here is the C struct: >&

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

2017-12-14 Thread snmed
n't it? Cheers Am Donnerstag, 14. Dezember 2017 09:29:38 UTC+1 schrieb snmed: > > Hi Miki > > I'm using syscall package and no C import, but maybe it is possible to use > this function as well? > > Am Donnerstag, 14. Dezember 2017 09:18:26 UTC+1 schrieb Miki Tebeka: >> >&

[go-nuts] Profiling memory allocations for a function

2017-12-20 Thread snmed
0.01s 0.5% 3.47% 0.01s 0.5% bitbucket.org/snmed/mw/log.(* scanner).openToken C:\Projects\goworkspace\src\bitbucket.org\snmed\mw\log\ scanner.go 0.01s 0.5% 3.96% 0.01s 0.5% bitbucket.org/snmed/mw/log.(* scanner).propIDToken C:\Projects\goworkspace\src\bitbucket.org

[go-nuts] Re: concurrency programing about go

2017-11-02 Thread snmed
) { a = "hello,world\n" } func doprint() { once.Do(setup) fmt.Print(a) } func twoprint() { var wg sync.WaitGroup wg.Add(2) go func() { doprint() wg.Done() }() go func() { doprint() wg.Done() }() wg.Wait() } func main() { twoprint() } Cheers snmed Am Donnerstag, 2. November 2017

[go-nuts] Re: Webservices with Windows Authentication

2017-12-10 Thread snmed
iple LDAP and AD servers > in a "federated fashion", trying the servers with the credentials > supplied. Hope this helps. > > cheers, > Paul > > On Saturday, 9 December 2017 14:59:41 UTC-8, snmed wrote: >> >> Hi all >> >> We are primarly

[go-nuts] Re: Webservices with Windows Authentication

2017-12-10 Thread snmed
; > https://github.com/Azure/go-ntlmssp > https://github.com/ThomsonReutersEikon/go-ntlm > <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FThomsonReutersEikon%2Fgo-ntlm=D=1=AFQjCNGmPLiRsJ_mi2PmXY8RFjVKscoqOg> > > Mike > > On Saturday, December 9, 2017 at 5:59:41 PM UTC-5

[go-nuts] Re: concurrency programing about go

2017-10-30 Thread snmed
Hi There are several ways to solve it, here are two of them: https://play.golang.org/p/wJwkI7HQwv https://play.golang.org/p/nasUcgBeG4 I prefer the first one, because so I can decide if i want to wait for the end of twoprint or not. Cheers Am Montag, 30. Oktober 2017 06:43:45 UTC+1 schrieb

[go-nuts] Re: Struct members, hide or export?

2018-08-09 Thread snmed
Hi I would suggest to use the second option. If you export all possible members, you have to care on every redesign who and how this members are used. This makes a redesign unnecessarily tricky. Constructor functions are a common pattern in go code and therefore you should not flinch to use

[go-nuts] TLS mutual auth: trusting a single client certificate?

2018-01-23 Thread snmed
Hi As far as I understand, you can set this function VerifyPeerCertificate in the tls config and then verify the thumbprint of the client certificate. This method is only called, when the client has a valid certificate. Cheers Sandro -- You received this message because you are subscribed

[go-nuts] Re: constructors vs lazy initialization

2018-03-11 Thread snmed
But this is only working as long as you do not need any services or dependencies. And in that case i would really appreciate if the language natively supports a nil check on method parameters at compile time. For all cases where nil is a valid value, the language needs a marker to allow such

[go-nuts] Statically compile and link a go program with C dependencies

2019-01-21 Thread snmed
Hi all I try to compile and statically link the following example: https://github.com/rthornton128/goncurses/tree/master/examples/curs_menu I use this command: go build -ldflags '-w -extldflags "-static"' -a Unfortunately i get only this: /usr/lib/go/pkg/tool/linux_amd64/link: running gcc

Re: [go-nuts] Statically compile and link a go program with C dependencies

2019-01-21 Thread snmed
> libs will have a ".so" or ".dylib" extension. "In general" because this is > platform dependent and you could be working on a platform with different > conventions. > > On Mon, Jan 21, 2019 at 7:50 AM snmed > > wrote: > >> Hi all &g

[go-nuts] Go offline development recommendations

2018-12-12 Thread snmed
Hi all Our customer demands an offline development environment with no internet connection, is there any best practices to handle package download and project setup for such an use case? And how would the new go modules fit in in such an environment? Any advise will be most appreciated.

Re: [go-nuts] Go offline development recommendations

2018-12-12 Thread snmed
t; walkthrough here: > > > https://github.com/go-modules-by-example/index/blob/master/012_modvendor/README.md > > Best, > thepudds > > On Wednesday, December 12, 2018 at 3:52:58 PM UTC-5, snmed wrote: >> >> Thank you for you reply, >> >> yes i have alrea

Re: [go-nuts] Go offline development recommendations

2018-12-12 Thread snmed
as proxy and try to preload all required packages some how. Am Mittwoch, 12. Dezember 2018 22:19:14 UTC+1 schrieb Tom Mitchell: > > > On Wed, Dec 12, 2018 at 12:00 PM snmed > > wrote: > >> Hi all >> >> Our customer demands an offline development environ

Re: [go-nuts] Go offline development recommendations

2018-12-12 Thread snmed
in advance Sandro Am Mittwoch, 12. Dezember 2018 21:04:07 UTC+1 schrieb Burak Serdar: > > On Wed, Dec 12, 2018 at 1:00 PM snmed > > wrote: > > > > Hi all > > > > Our customer demands an offline development environment with no internet > connection

Re: [go-nuts] Go offline development recommendations

2018-12-12 Thread snmed
the GOPROXY to the athens instance. Cheers Am Mittwoch, 12. Dezember 2018 23:51:08 UTC+1 schrieb ohir: > > On Wed, 12 Dec 2018 11:59:59 -0800 (PST) > snmed > wrote: > > > Hi all > > > > Our customer demands an offline development environment with no internet

Re: [go-nuts] Go offline development recommendations

2018-12-13 Thread snmed
+1 schrieb ohir: > > On Wed, 12 Dec 2018 22:15:23 -0800 (PST) > snmed > wrote: > > > Thank you very much for your reply. It seems to be a possible way to do > it, > > what do you think about the athens way? > > From the secop pov it'll be a hells gate. Also i

Re: [go-nuts] Go offline development recommendations

2018-12-13 Thread snmed
in similarly restrictive > environments. > On Thu, Dec 13, 2018 at 09:00, akshita babel > wrote: > >> Hey, can anyone guide me on how to take octet stream as input in API >> and/or how to convert octet stream to byte array using golang >> >> On Thu, Dec 13, 2018

[go-nuts] C Third Party Lib CGO

2021-07-07 Thread snmed
Hi all Once again I have a 3th party library which looks like this example: https://play.golang.org/p/Ue9yQ8s8Ymq and I need it to integrate in our go tool. The example is working but is still get the warning " possible misuse of unsafe.Pointer". So my questions are: 1. Can I use uintptr

[go-nuts] Re: C Third Party Lib CGO

2021-07-08 Thread snmed
quot;, CGO documentation is not very clear to me about the intricacies of type conversions between Go and C. Cheers Tamás Gulácsi schrieb am Donnerstag, 8. Juli 2021 um 16:52:01 UTC+2: > Use *C.MyAppPtr on Go side, don't hide it behind an uintptr. > > snmed a következőt írta (2021. július 7., sze

Re: [go-nuts] Re: C Third Party Lib CGO

2021-07-09 Thread snmed
t; preventing any memory movement > int that block of code. > > Tamas > snmed a következőt írta (2021. július 9., péntek, 8:21:37 UTC+2): > >> Thx Ian to pointing me to the documentation I read it, but still unsure >> regarding my example. Probably rule number 4 could apply,

Re: [go-nuts] Re: C Third Party Lib CGO

2021-07-09 Thread snmed
to a(n unsafe.)Pointer > triggers the warnings. Only the special specified cases are legal. > > TL;DR; Do not use uintptr. > (More elaborate: do not use an uintptr to store and retrieve a pointer - > just store the pointer directly). > > Tamas > > snmed a következőt írta (

Re: [go-nuts] Re: C Third Party Lib CGO

2021-07-09 Thread snmed
. It is still a valid memory address in C and therefore should be interpreted as pointer in C, right? So therefore the warning can be ignored or do I miss something important? Cheers Sandro Ian Lance Taylor schrieb am Freitag, 9. Juli 2021 um 05:37:16 UTC+2: > On Thu, Jul 8, 2021 at 10:09 AM sn

[go-nuts] Tool go-offline-packager

2021-02-28 Thread snmed
Hi all If anyone is interested, i made a little tool to download and package go modules for air-gapped environments. Here the link to the repo: https://github.com/go-sharp/go-offline-packager Any comments or suggestions are most welcome. Cheers, Sandro -- You received this message because

[go-nuts] XML Schema Validation

2021-10-12 Thread snmed
Hi there, I wondering why there is no pure XML Schema validation library in go or even in the go std. Is there any best practice to validate xml schemas in go? Cheers, Sandro -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Re: Logging in to web services

2021-10-12 Thread snmed
Hi Denis, I'm not sure if I understand your question correctly, but it seems to me that you need a context with user specific data. Therefore, I would create a handler that will add the current user to the context and then you can access it in every handler where you need it. User of your site