Re: [go-nuts] Re: error in testcode

2021-03-29 Thread Dr. Lincy Jim
I did

func TestProvisionhistory(t *testing.T) {

type fields struct {

StatusStatus

Type  BookingType

Updated   time.Time

History   []BookingHistory



}

type args struct {

b *Booking

}

tests := []struct {

name   string

fields fields

args   args

for _, tt := range tests {

t.Run(tt.name, func(t *testing.T) {
bl := {
Status:tt.fields.Status}
if bl.Status == StatusExpired && bl.Status != StatusCancelled {

t.Error("expecting status of bookinglisting to be active")

}



bl.provisionHistory(tt.args.b)

})

}
}

now i am getting  ok in the terminal

is this all that is required from writing If b1.status test code

Thanks and Regards/-
*Dr.Lincy Elizebeth Jim,*



On Mon, Mar 29, 2021 at 6:20 PM Brian Candler  wrote:

> Can you make a complete, runnable example which demonstrates the problem,
> on play.golang.org, and post the link here?
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/gxtF2eEzjLI/unsubscribe.
> To unsubscribe from this group and all its topics, 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/dabb8639-fec8-4c28-bab2-9d4484dd7716n%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/CAMcLrA85rraSxLuw7CnF4gg1nphqOhu%3D%3DNm68DzQWG_oh8XU0Q%40mail.gmail.com.


[go-nuts] error in testcode

2021-03-29 Thread Dr. Lincy Jim
Hi all,

I have included the following lines of code
if b.ConsentProvided {
var t string
if bl.Status != StatusExpired && bl.Status != StatusCancelled {

t = fmt.Sprintf("Consent to share information by %s", 
bl.RequestedBy) //lchangetest1
if len(bl.RequestedBy) == 0 {
t = "Consent to share information"

}

} else {
t = "Consent to share information"
}
how to write a test code for this 

I wrote
func TestProvisionhistory(t *testing.T) {
bl := BookingListing {
Status:"Expired"}
var thh = b1.provisionHistory(t.Booking)

if thh.Status != StatusExpired && thh.Status != StatusCancelled {
t.Error("Fail")
} else {
t.Error("True")
}
Booking listing is a struct

What am  I doing wrong?

thanking in advance

-- 
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/f09f16a0-5718-4d19-8f37-ba1eaabc723dn%40googlegroups.com.


Re: [go-nuts] upgrade golang to 1.1.5 in vscode not showing

2021-03-25 Thread Dr. Lincy Jim
Hi Kurtis,

I reinstalled vscode,ubuntu and wsl as the cache kept holding onto previous 
installations of go.
Now it correctly shows go 15 at the bottom of the vscode window.
I typed 'which-a go'
now it shows usr/local/go/bin/go
Now the issue has been resolved.Thanks again.

On Thursday, March 25, 2021 at 3:41:41 PM UTC+11 Kurtis Rader wrote:

> On Wed, Mar 24, 2021 at 9:16 PM Dr. Lincy Jim  wrote:
>
>> Yes I am using Go in WSL(Sorry I forgot to mention it)
>> go 1.13 version is in Networks 
>> \\wsl$\Ubuntu\home\lincy\go
>>
>> but the 1.15 version is in  Networks  \\wsl$\Ubuntu\user\local (go 1.15 
>> has been extracted here)
>>
>> Should i manually copy the go 15 folder and place it where go 13 is?
>> In Vscode at the bottom of the  window it shows go 1.13? how do I change 
>> it to go 1.15
>>
>
> This is really a question for your whomever told you to upgrade from Go 
> 1.13 to 1.15. We have no idea why you were told to upgrade. Or who told you 
> to do the upgrade. Presumably it was the IT department responsible for the 
> computers you use at your $dayjob.
>
> I'll start by pointing out that you did not show us the output of `which 
> -a go`. Nonetheless, the information you did provide implies you have the 
> WSL equivalent of `\\wsl$\Ubuntu\home\lincy\go` (version 1.13) in your PATH 
> ahead of `\\wsl$\Ubuntu\user\local` (version 1.15). Perhaps you should just 
> delete your personal copy of the Go toolchain installed in 
> `\\wsl$\Ubuntu\home\lincy\go`. But, again, not knowing anything about your 
> $dayjob computer environment it might also be the case that you should have 
> installed the new version of Go in your personal directory rather than 
> /usr/local/.
>
> -- 
> 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/b4a82017-d42d-47e4-891c-debe372862d5n%40googlegroups.com.


Re: [go-nuts] upgrade golang to 1.1.5 in vscode not showing

2021-03-24 Thread Dr. Lincy Jim

Hi Kurtis,

Yes I am using Go in WSL(Sorry I forgot to mention it)
go 1.13 version is in Networks 
\\wsl$\Ubuntu\home\lincy\go

but the 1.15 version is in  Networks  \\wsl$\Ubuntu\user\local (go 1.15 has 
been extracted here)

Should i manually copy the go 15 folder and place it where go 13 is?
In Vscode at the bottom of the  window it shows go 1.13? how do I change it 
to go 1.15

kindly guide
thanking in advance


On Thursday, March 25, 2021 at 2:38:34 PM UTC+11 Kurtis Rader wrote:

> You say you are using Windows 10 but the commands you showed us makes it 
> clear you are using Go in WSL (Windows Subsystem for Linux) rather than 
> native Windows 10. I mention this because it is an important detail.
>
> You modify the PATH env var in your current shell but then run `source 
> ~/.bashrc`. If your ~/.bashrc modifies the PATH env var your manual edit 
> will probably have no effect. What does `which -a go` output? It seems 
> likely that you have more than one installation of the Go toolchain with 
> the 1.13 version being some place other than /usr/local/go/bin.
>
> On Wed, Mar 24, 2021 at 8:26 PM Dr. Lincy Jim  wrote:
>
>> Hi,
>>
>> My os is windows 10 on which i have installed golang1.16 andd the version 
>> of golang on my vscode is1.13
>> but since I am using my laptop for work ,i have been asked to upgrade 
>> from 1.13 to 1.15
>> I did the following steps in terminal of vscode-ubuntu
>> $ sudo wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz
>> $ sudo tar -C /usr/local -xzf go1.15.5.linux-amd64.tar.gz
>> $ export PATH=$PATH:/usr/local/go/bin
>> $ source ~/.bashrc
>> $ go version
>>
>> still it shows version 1.13
>>
>> kindly guide
>> thanking in advance
>>
>> -- 
>> 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/ac8694ce-6a9d-4ae1-9e91-66b283f1ac50n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/ac8694ce-6a9d-4ae1-9e91-66b283f1ac50n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> -- 
> 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/0b56fb92-fd0b-4ad0-a67b-fcd5829a2ef3n%40googlegroups.com.


[go-nuts] upgrade golang to 1.1.5 in vscode not showing

2021-03-24 Thread Dr. Lincy Jim


Hi,

My os is windows 10 on which i have installed golang1.16 andd the version 
of golang on my vscode is1.13
but since I am using my laptop for work ,i have been asked to upgrade from 
1.13 to 1.15
I did the following steps in terminal of vscode-ubuntu
$ sudo wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.15.5.linux-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
$ source ~/.bashrc
$ go version

still it shows version 1.13

kindly guide
thanking in advance

-- 
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/ac8694ce-6a9d-4ae1-9e91-66b283f1ac50n%40googlegroups.com.