[go-nuts] Proposal to add EvalJSONPointer function to support RFC 6901 in Go

2020-10-15 Thread Baiju Muthukadan
Hi, I have created a proposal to add EvalJSONPointer function to support RFC 6901 in Go. https://github.com/golang/go/issues/42009 Please take a look and add your comments! Regards, Baiju Muthukadan -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Unable to create a specific file in windows

2020-10-15 Thread Kurtis Rader
On Thu, Oct 15, 2020 at 8:00 PM nilsocket wrote: > No, dir "a" is being created. Yes, I understand you are trying to create the directory. My point is that you don't verify that the `os.MkdirAll` call succeeds. On my Windows 10 system your program works fine unless I create a file named "a"

Re: [go-nuts] Unable to create a specific file in windows

2020-10-15 Thread nilsocket
No, dir "a" is being created. Intact, I was testing out big list of naughty strings, I didn't have problem with any string but this one. Regarding error, I don't mean error is "linked picture", I mean, for error one can look at the picture which I have linked. On Friday, October 16, 2020 at

Re: [go-nuts] Unable to create a specific file in windows

2020-10-15 Thread Kurtis Rader
On Thu, Oct 15, 2020 at 7:29 PM Kurtis Rader wrote: > Works for me. Of course the actual error you're seeing is "The system > cannot find the path specified", not "Linked picture". You're not checking > the error returned by `os.MkdirAll` so I would presume that creating the > directory "a" is

Re: [go-nuts] Unable to create a specific file in windows

2020-10-15 Thread Kurtis Rader
Works for me. Of course the actual error you're seeing is "The system cannot find the path specified", not "Linked picture". You're not checking the error returned by `os.MkdirAll` so I would presume that creating the directory "a" is failing on your system. Try printing the error returned by

Re: [go-nuts] Re: Getting syntax-error on from assignment in if statements

2020-10-15 Thread Ariel Mashraki
Good to know that. Thanks for your response Ian. On Thursday, October 15, 2020 at 6:42:33 PM UTC+3 Ian Davis wrote: > On Thu, 15 Oct 2020, at 4:16 PM, Brian Candler wrote: > > It looks like a parsing ambiguity to me. The error suggests that the > open-brace is being treated as the start of

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread Joop Kiefte
You basically have to see the test file as an alternative package main, which can but (generally?) does not have to have access to the contents of the main package, as such you don't have access to the drivers by default... [Joop Kiefte - Chat @

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread farid sobhany
Thanks for this explanation. I have looked into the go.sum and found an mssql driver in there which was used in another package two levels above where I was testing. The driver that was needed was mssql not mysql; which was the reason why my first import of the mysql driver in the test file

[go-nuts] New generic purpose throttler library for Go that comes with builtin integrations for popular Go libraries

2020-10-15 Thread John Brown
Library has vast amount of different built throttler conditions, among which are: - leaky-bucket - latency threshold - metrics - etc. Library allows to easily combine them into more complex throttling pipelines and also ships tools to easily integrate it into existing infrastructure, for e.g.

[go-nuts] Re: implementing macro in plan 9 assembly

2020-10-15 Thread Anthony Martin
saurav deshpande once said: > How to implement macro in plan9 assembly? I read the documentation of > plan9 assembly but could not find it. Is there any alternative for > macro in plan9? Assembly language source files are preprocessed just like C source. The familiar #define and #include

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread 'Axel Wagner' via golang-nuts
FWIW, the import of the driver doesn't have to be in the main-package itself, it could also be in one of its transitive imports (which isn't imported transitively by the test). Is there an `mssql` module in your `go.sum`? If so, you could use `go mod why` to find out how it's imported. On Thu,

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread farid sobhany
Understand. Here is the piece of code that does the connection: // dbInfo = sqlserver://gh:password!655@localhost:7867?database=test_database db, err := sql.Open("mssql", dbInfo) if err != nil { log.Errorf("Could not open database: %s\n %s\n", dbInfo, err.Error()) return

[go-nuts] implementing macro in plan 9 assembly

2020-10-15 Thread saurav deshpande
How to implement macro in plan9 assembly? I read the documentation of plan9 assembly but could not find it. Is there any alternative for macro in plan9? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread Joop Kiefte
I mean the full command that has the connection string in it, most importantly the driver string. Sorry for not putting that as clearly as I could... [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=q8f5w) [q8f5w] On October 15, 2020 at 16:19 GMT, farid

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread farid sobhany
The connection works when running the application. Here is the connection string (changed sensitive info): sqlserver://gh:password!655@localhost:7867?database=test_database Thanks On Thursday, October 15, 2020 at 6:36:11 AM UTC-7 iko...@gmail.com wrote: > Just a hunch, what does your

Re: [go-nuts] Re: Getting syntax-error on from assignment in if statements

2020-10-15 Thread Ian Davis
On Thu, 15 Oct 2020, at 4:16 PM, Brian Candler wrote: > It looks like a parsing ambiguity to me. The error suggests that the > open-brace is being treated as the start of the body of the if-statement, i.e. > > if v := T { > }.F() > > Try changing it to > > if v == T{}.F(); v {} > > and

[go-nuts] Re: Getting syntax-error on from assignment in if statements

2020-10-15 Thread Brian Candler
It looks like a parsing ambiguity to me. The error suggests that the open-brace is being treated as the start of the body of the if-statement, i.e. if v := T { }.F() Try changing it to if v == T{}.F(); v {} and you'll get a different error: "syntax error: unexpected . at end of statement"

[go-nuts] Getting syntax-error on from assignment in if statements

2020-10-15 Thread Ariel Mashraki
Giving these 2 statements (in main function), the first passes and the second causes a parse-error. type T struct{} func (T) F() bool { return true } func main() { v := T{}.F() // works if v := T{}.F(); v {} // syntax error: cannot use v := T as value } I went over the grammar rules of the

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread Joop Kiefte
Just a hunch, what does your connection string look like? [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=q87fr) [q87fr] On October 15, 2020 at 13:30 GMT, farid sobhany wrote: I have searched the whole application for that import, and I couldn't find

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread farid sobhany
I have searched the whole application for that import, and I couldn't find it. I did import it in the test file and still got the same error. On Thursday, October 15, 2020 at 12:43:36 AM UTC-7 be...@pferdewetten.de wrote: > Maybe you're importing it somewhere else in your main package. In any

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread Gregor Best
Maybe you're importing it somewhere else in your main package. In any case, adding an anonymous import in one of your _test.go-files should do the trick. On 15.10.20 03:53, farid sobhany wrote: I am using database/sql to connect to a Mssql server and it works when I run the application. But

[go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread farid sobhany
I am using database/sql to connect to a Mssql server and it works when I run the application. But when I setup a test file and tried to call the function that makes the connection and store it in an instance, it complains about "Unknown driver \"mssql\" (forgotten import?)" I am not importing

Re: [go-nuts] Positional arguments and flag package

2020-10-15 Thread Roland Müller
I guess it's usage of flag is meant in to behave like parsing flags in Unix/LInux, or Python' argparse: - after the command you have the flags denoted by '-' - after flags follow rest of command line args where elements can be every character string BR, Roland Am Fr., 9. Okt. 2020 um

Re: [go-nuts] Positional arguments and flag package

2020-10-15 Thread Roland Müller
Actually, it's explicitly documented, so I don't have to guess: https://golang.org/pkg/flag/#hdr-Command_line_flag_syntax Am Do., 15. Okt. 2020 um 08:22 Uhr schrieb Roland Müller : > I guess it's usage of flag is meant in to behave like parsing flags in > Unix/LInux, or Python' argparse: > >