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

2020-10-16 Thread Kurtis Rader
On Fri, Oct 16, 2020 at 2:36 PM nilsocket  wrote:

> I was trying to create a package which sanitizes file name, for testing
> purposes, I choose blns
> .
>
> I create a directory, named "blns" and sanitize names from blns and create
> those files in "blns" directory.
>

Your problem reproduction program does not do that. It creates a directory
named "a".


> I have tested 516 strings in Linux, everything worked fine, for sake of
> cross-compatibility I choose to test in windows, then I got this problem.
>
> I was able to create 515 files in "blns" directory but this one.
>
> Since You were not able to reproduce, I will consider some kind of problem
> with windows OS and skip it, as this is error is from windows system calls.
>

I was able to reproduce your problem. Specifically, by creating a
non-directory (such as a regular file) named "a". That causes the
os.MkdirAll call to fail. Does the program you included in your first email
actually fail? If so, what is the return value of the os.MkdirAll call?

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD_-vtF4Mw8gMca%3DmHaYdYuzRVxDdJWNqVrvhV%2B76qg-iA%40mail.gmail.com.


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

2020-10-16 Thread Ian Lance Taylor
On Fri, Oct 16, 2020 at 2:36 PM nilsocket  wrote:
>
> I was trying to create a package which sanitizes file name, for testing 
> purposes, I choose blns.
>
> I create a directory, named "blns" and sanitize names from blns and create 
> those files in "blns" directory.
>
> I have tested 516 strings in Linux, everything worked fine, for sake of 
> cross-compatibility I choose to test in windows, then I got this problem.
>
> I was able to create 515 files in "blns" directory but this one.
>
> Since You were not able to reproduce, I will consider some kind of problem 
> with windows OS and skip it, as this is error is from windows system calls.

I don't think you understand the earlier comment, so I will restate it.

Your sample code says

os.MkdirAll(dir, os.ModePerm)

Do not do that.

Instead write

if err := os.MkdirAll(dir, os.ModePerm); err != nil {
log.Println(err)
return
}

Ian


> On Friday, October 16, 2020 at 8:39:03 AM UTC+5:30 Kurtis Rader wrote:
>>
>> 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" before 
>> running your program. Please modify your program to check the error value 
>> returned by `os.MkdirAll` and verify that it is nil.
>>
>>>
>>> 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.
>>
>>
>> That wasn't obvious at first glance. The indirection also wasn't necessary. 
>> All you had to do was write that the error was something like this (what I 
>> saw when I deliberately induced a failure by running "touch a"):
>>
>> 2020/10/15 19:32:16 open a\408_-IMG 
>> SRC=
>> 114
>> 39-: The system cannot find the 
>> path specified.
>>
>> --
>> Kurtis Rader
>> Caretaker of the exceptional canines Junior and Hank
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/bf97b64b-b243-4b67-8c7e-d6e7e3895aecn%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWg0Q1B_BqXtd%3D9LYQf5fTG2nqz0Y%3DtB7bDg%3DR-KVnU2g%40mail.gmail.com.


Re: [go-nuts] net/http TLS issue

2020-10-16 Thread Marcin Romaszewicz
Having a passcode to protect a key file for a production service is
pointless, because you move the problem of storing the certificate securely
to the problem of storing the passcode securely, so might as well skip the
passcode and store the cert securely.

Your certificate is probably encoded as a PEM cert, so you'd have to
manually call https://golang.org/pkg/crypto/x509/#DecryptPEMBlock and
provide a password, then construct your listener yourself using the
unmarshaled certificate. So, how are you going to protect this passcode? Is
someone going to have to provide it every time you start?

Generally, in production systems, we use some kind of secret manager to
store that certificate, such as AWS Secrets Manager or encrypt it with KMS,
store it in Vault, etc. Ideally, you actually make a subordinate cert for
that service and rotate it at a reasonable interval.

On Fri, Oct 16, 2020 at 2:06 PM Rich  wrote:

> I don't know if we're the only company on the planet that demands the
> https keys have a passcode to them but I've been having a heck of a time
> trying to find a good way to serve https using a key with a passphrase.
>
> err := ListenAndServeTLS(addr, certFile, keyFile string
> , handler Handler
> )
>
> If they keyFile has a passcode this doesn't work and the examples I've
> seen take this one line and turn it into a much longer chunk of code.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/c75fc8f6-abe4-4614-8281-cef4cb315ac3n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bv29LtOt-JXdpfvTFMhLMFS729PR0ASe_4xMsQzEkvDN%2BigjA%40mail.gmail.com.


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

2020-10-16 Thread nilsocket
I was trying to create a package which sanitizes file name, for testing 
purposes, I choose blns 
.

I create a directory, named "blns" and sanitize names from blns and create 
those files in "blns" directory.

I have tested 516 strings in Linux, everything worked fine, for sake of 
cross-compatibility I choose to test in windows, then I got this problem.

I was able to create 515 files in "blns" directory but this one.

Since You were not able to reproduce, I will consider some kind of problem 
with windows OS and skip it, as this is error is from windows system calls.

On Friday, October 16, 2020 at 8:39:03 AM UTC+5:30 Kurtis Rader wrote:

> 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" before 
> running your program. Please modify your program to check the error value 
> returned by `os.MkdirAll` and verify that it is nil.
>  
>
>> 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.
>>
>
> That wasn't obvious at first glance. The indirection also wasn't 
> necessary. All you had to do was write that the error was something like 
> this (what I saw when I deliberately induced a failure by running "touch 
> a"):
>
> 2020/10/15 19:32:16 open a\408_-IMG 
> SRC=
>
> 114
> 39-: The system cannot find 
> the path specified.
>
> -- 
> Kurtis Rader
> Caretaker of the exceptional canines Junior and Hank
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/bf97b64b-b243-4b67-8c7e-d6e7e3895aecn%40googlegroups.com.


[go-nuts] net/http TLS issue

2020-10-16 Thread Rich
I don't know if we're the only company on the planet that demands the https 
keys have a passcode to them but I've been having a heck of a time trying 
to find a good way to serve https using a key with a passphrase.  

err := ListenAndServeTLS(addr, certFile, keyFile string 
, handler Handler 
)  

If they keyFile has a passcode this doesn't work and the examples I've seen 
take this one line and turn it into a much longer chunk of code.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c75fc8f6-abe4-4614-8281-cef4cb315ac3n%40googlegroups.com.


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

2020-10-16 Thread saurav deshpande
okay, Thank you 

On Friday, October 16, 2020 at 6:06:34 PM UTC+5:30 iko...@gmail.com wrote:

> I think you can use nasm assembly through inline ASM in cgo indirectly... 
> Go supports writing .s-files written in Go's internal assembly format, 
> which should be much faster than cgo to compile and is probably preferable, 
> but needs a bit of learning.
>
>   *Joop Kiefte* - Chat @ Spike 
> 
> [image: q9zcd]
>
> On October 16, 2020 at 12:30 GMT, saurav deshpande <
> saurav.des...@gmail.com> wrote:
>
> So, is it possible to define functions declared in go and defined in nasm 
> assembly? If yes then can you please share an example.
>
> Thank you
>
> On Friday, October 16, 2020 at 5:39:33 PM UTC+5:30 iko...@gmail.com wrote:
>
>> I don't know how this should actually be done, but remember that the Go 
>> assembly is not actually Plan 9 assembly, it's an abstraction by itself, 
>> meant for internal use first and foremost.
>>
>>   *Joop Kiefte* - Chat @ Spike 
>>  [image: 
>> q9y39]
>>
>> On October 16, 2020 at 10:20 GMT, saurav deshpande <
>> saurav.des...@gmail.com> wrote:
>>
>>
>> Thank you for the reply.
>> I do not understand, actually I am trying to define the fuctions in plan9 
>> assembly  whoes declaration is done in a go file. I want to use macro like 
>> the macro in nasm, but couldn't understand how to do it.
>> It would be very helpful if you could give an example.
>>
>> Thank you.
>>
>>
>> On Friday, October 16, 2020 at 12:07:23 AM UTC+5:30 al...@pbrane.org 
>> wrote:
>>
>>> 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 directives should work as expected. 
>>>
>>> Anthony 
>>>
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/c779e51f-ff41-4686-a843-0830316383c3n%40googlegroups.com
>>  
>> 
>> .
>>
>> -- 
> 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.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/79b37153-fcc1-4a5f-85ea-6127d28465d8n%40googlegroups.com
>  
> 
> .
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f1170b24-bcbe-4e2c-8f91-2f992d810203n%40googlegroups.com.


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

2020-10-16 Thread Joop Kiefte
I think you can use nasm assembly through inline ASM in cgo indirectly... Go 
supports writing .s-files written in Go's internal assembly format, which 
should be much faster than cgo to compile and is probably preferable, but needs 
a bit of learning.

[Joop Kiefte - Chat @ 
Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=q9zcd)   
[q9zcd]

On October 16, 2020 at 12:30 GMT, saurav deshpande 
 wrote:

So, is it possible to define functions declared in go and defined in nasm 
assembly? If yes then can you please share an example.

Thank you

On Friday, October 16, 2020 at 5:39:33 PM UTC+5:30 iko...@gmail.com wrote:

I don't know how this should actually be done, but remember that the Go 
assembly is not actually Plan 9 assembly, it's an abstraction by itself, meant 
for internal use first and foremost.

[Joop Kiefte - Chat @ 
Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=q9y39)   
[q9y39]

On October 16, 2020 at 10:20 GMT, saurav deshpande  
wrote:

Thank you for the reply.
I do not understand, actually I am trying to define the fuctions in plan9 
assembly whoes declaration is done in a go file. I want to use macro like the 
macro in nasm, but couldn't understand how to do it.
It would be very helpful if you could give an example.

Thank you.

On Friday, October 16, 2020 at 12:07:23 AM UTC+5:30 al...@pbrane.org wrote:

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 directives should work as expected.

Anthony

--
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.
To view this discussion on the web visit 
[https://groups.google.com/d/msgid/golang-nuts/c779e51f-ff41-4686-a843-0830316383c3n%40googlegroups.com](https://groups.google.com/d/msgid/golang-nuts/c779e51f-ff41-4686-a843-0830316383c3n%40googlegroups.com?utm_medium=email_source=footer).

--
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.
To view this discussion on the web visit 
[https://groups.google.com/d/msgid/golang-nuts/79b37153-fcc1-4a5f-85ea-6127d28465d8n%40googlegroups.com](https://groups.google.com/d/msgid/golang-nuts/79b37153-fcc1-4a5f-85ea-6127d28465d8n%40googlegroups.com?utm_medium=email_source=footer).

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c-64693-kgc8j4wr-8hbgi2%3D8prlvb%402.gethop.com.


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

2020-10-16 Thread saurav deshpande
So, is it possible to define functions declared in go and defined in nasm 
assembly? If yes then can you please share an example.

Thank you

On Friday, October 16, 2020 at 5:39:33 PM UTC+5:30 iko...@gmail.com wrote:

> I don't know how this should actually be done, but remember that the Go 
> assembly is not actually Plan 9 assembly, it's an abstraction by itself, 
> meant for internal use first and foremost.
>
>   *Joop Kiefte* - Chat @ Spike 
>  [image: 
> q9y39]
>
> On October 16, 2020 at 10:20 GMT, saurav deshpande <
> saurav.des...@gmail.com> wrote:
>
>
> Thank you for the reply.
> I do not understand, actually I am trying to define the fuctions in plan9 
> assembly  whoes declaration is done in a go file. I want to use macro like 
> the macro in nasm, but couldn't understand how to do it.
> It would be very helpful if you could give an example.
>
> Thank you.
>
>
> On Friday, October 16, 2020 at 12:07:23 AM UTC+5:30 al...@pbrane.org 
> wrote:
>
>> 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 directives should work as expected. 
>>
>> Anthony 
>>
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/c779e51f-ff41-4686-a843-0830316383c3n%40googlegroups.com
>  
> 
> .
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/79b37153-fcc1-4a5f-85ea-6127d28465d8n%40googlegroups.com.


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

2020-10-16 Thread Joop Kiefte
I don't know how this should actually be done, but remember that the Go 
assembly is not actually Plan 9 assembly, it's an abstraction by itself, meant 
for internal use first and foremost.

[Joop Kiefte - Chat @ 
Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=q9y39)   
[q9y39]

On October 16, 2020 at 10:20 GMT, saurav deshpande 
 wrote:

Thank you for the reply.
I do not understand, actually I am trying to define the fuctions in plan9 
assembly whoes declaration is done in a go file. I want to use macro like the 
macro in nasm, but couldn't understand how to do it.
It would be very helpful if you could give an example.

Thank you.

On Friday, October 16, 2020 at 12:07:23 AM UTC+5:30 al...@pbrane.org wrote:

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 directives should work as expected.

Anthony

--
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.
To view this discussion on the web visit 
[https://groups.google.com/d/msgid/golang-nuts/c779e51f-ff41-4686-a843-0830316383c3n%40googlegroups.com](https://groups.google.com/d/msgid/golang-nuts/c779e51f-ff41-4686-a843-0830316383c3n%40googlegroups.com?utm_medium=email_source=footer).

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c-64693-kgc7kc4e-ghrrky%3Da5lrqg%402.gethop.com.


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

2020-10-16 Thread saurav deshpande
Thank you for the reply.
I do not understand, actually I am trying to define the fuctions in plan9 
assembly  whoes declaration is done in a go file. I want to use macro like 
the macro in nasm, but couldn't understand how to do it.
It would be very helpful if you could give an example.

Thank you.


On Friday, October 16, 2020 at 12:07:23 AM UTC+5:30 al...@pbrane.org wrote:

> 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 directives should work as expected.
>
> Anthony
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c779e51f-ff41-4686-a843-0830316383c3n%40googlegroups.com.


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

2020-10-16 Thread farid sobhany
I was thinking, since I am calling the same function from package main, it
will have access to its dependences. I guess that function was using the
driver through another controller it was called in.
The go mod why really helped.


On Thu, Oct 15, 2020, 2:07 PM Joop Kiefte  wrote:

> 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 @ Spike
>  [image:
> q8sct]
>
> On October 15, 2020 at 20:28 GMT, farid sobhany 
> wrote:
>
>
> 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
> didn't work. I have included the driver in my test file and it works.
> But the question remains.. I was calling the same functions to open a
> connection in my test file.. Why couldn't that function use the
> dependencies same way it was using it when not testing?
>
> Thanks again Axel
>
> On Thursday, October 15, 2020 at 10:34:44 AM UTC-7
> axel.wa...@googlemail.com wrote:
>
>> 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, Oct 15, 2020 at 6:51 PM farid sobhany 
>> wrote:
>>
>>> 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 nil, err
>>> }
>>> err = db.Ping()
>>> if err != nil {
>>> log.Error("db Ping error:", err)
>>> return nil, err
>>> }
>>>
>>> Thanks
>>>
>>> On Thursday, October 15, 2020 at 9:23:10 AM UTC-7 iko...@gmail.com
>>> wrote:
>>>
 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
 
 [image: q8f5w]

 On October 15, 2020 at 16:19 GMT, farid sobhany 
 wrote:


 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 connection string look like?
>
>   *Joop Kiefte* - Chat @ Spike
>  [image:
> 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 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
>> 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 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 the driver in the main file and it works fine.
>> Why
>> > does it complain when running the test funciton?
>> >
>> > --
>> > 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
>> > .
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/golang-nuts/e8a43561-551b-44e1-8605-283ce1f064b0n%40googlegroups.com
>> > <
>> https://groups.google.com/d/msgid/golang-nuts/e8a43561-551b-44e1-8605-283ce1f064b0n%40googlegroups.com?utm_medium=email_source=footer>.
>>
>>
>> --
>> Gregor Best
>> be...@pferdewetten.de
>>
> --
>