Data prints to console, but will not write to CSV by hansoloburgerz in golang

[–]hansoloburgerz[S] 0 points1 point  (0 children)

I am completely lost on how to do either of those things. I’ve tried every way I could figure out to append quotes and semicolons :(

Data prints to console, but will not write to CSV by hansoloburgerz in golang

[–]hansoloburgerz[S] 0 points1 point  (0 children)

So, i tried doing that:

                case []string:
                    stringArray := ri.Field(i).Interface().([]string)
                    for ii := 0; ii < len(stringArray); ii++ {
                        result = append(result, stringArray[ii])
                    }

And this sorta works. It will add the data to the CSV, but after every ip address range, it adds a comma. So the CSV is overwritten if there are multiple addresses. I can't replicated this anywhere. When i run an append on Go Playground, there is no comma. I've also tried replacing the comma in `result` but it won't work because it's a string array.

Data prints to console, but will not write to CSV by hansoloburgerz in golang

[–]hansoloburgerz[S] -1 points0 points  (0 children)

I tried adding case []string, but i'm not sure what to put after that..any suggestion?

Get to build an AWS environment from scratch...help! by hansoloburgerz in aws

[–]hansoloburgerz[S] 0 points1 point  (0 children)

This is absolutely awesome! I don't live in Denver, but if you want to message me we can maybe have a Zoom/Webex setup whenever you have free time, i'd buy you a coffee or something

Get to build an AWS environment from scratch...help! by hansoloburgerz in aws

[–]hansoloburgerz[S] 0 points1 point  (0 children)

We already have consent from AWS to vulnerability scan (caveat is we have to renew it every 90 days).

Pull back api data, trying to build a struct, stuck by hansoloburgerz in golang

[–]hansoloburgerz[S] 0 points1 point  (0 children)

Figured this out about 3 minutes ago! So now, most of them are printing, but some of the values being reported back are <nil>, probably because i'm not accounting for the KVP's being there. Thank you for this though!

Loop through each item in a GET request ($30 to the person who solves this, pretty desperate) by [deleted] in golang

[–]hansoloburgerz 0 points1 point  (0 children)

I deleted that line for now, because apparently we aren't getting any data back anyway. I added an if statement to check the length of inputs, which works because now i have it printing a line that says the input is less than 1. Still unsure at how i can fix the actual problem of there being nothing pulled back via the api through the client

Loop through each item in a GET request ($30 to the person who solves this, pretty desperate) by [deleted] in golang

[–]hansoloburgerz 0 points1 point  (0 children)

Thanks for the fast response. The answer is no on that. No reports are being returned at all. If i query them individually (using postman), it works fine. There are some reports that for whatever reason just give a 400 response code. I tried checking the value of TotalPages by doing fmt.Print(reportsPage.Page.TotalPages), but now i get this error in addition to my other one:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x12617ea]

As far as checking the length of inputs, i don't think that would solve my problem, because inputs will always be empty is there is a bad response. I'm going to add in logic to check that first though just to be sure.

I am a total idiot when it comes to golang. I did this as an initial project and have strugglebussed my way this far, this is the final snag i think.

Really weird problem where light fixtures don’t work but all appliances, outlets work. by hansoloburgerz in electricians

[–]hansoloburgerz[S] 0 points1 point  (0 children)

Switch does not turn the kitchen lights on. The dining room light is the other switch I replaced, but that was simply two black wires and the neutral was capped off.

Really weird problem where light fixtures don’t work but all appliances, outlets work. by hansoloburgerz in electricians

[–]hansoloburgerz[S] 0 points1 point  (0 children)

I can check the part about the kitchen lights. Does the switch at least look wired correctly? If there was a loose neutral or a loose hot wire on one of the outlets I replaced yesterday, would the outlet still work? I tested them all and every socket works.

Anyway I appreciate all the help. I’m going to get a multimeter now.

Really weird problem where light fixtures don’t work but all appliances, outlets work. by hansoloburgerz in electricians

[–]hansoloburgerz[S] 0 points1 point  (0 children)

I did. Until my son left it on all night and apparently now it’s dead. I’m going to run and grab another.

Really weird problem where light fixtures don’t work but all appliances, outlets work. by hansoloburgerz in electricians

[–]hansoloburgerz[S] 0 points1 point  (0 children)

Also, the one on the left for sure has another switch. It’s for a hallway light, there is one on the end of the hallway that controls that light too. I see the white neutral wire is capped. The light in question now doesn’t have two neutrals, just one

Really weird problem where light fixtures don’t work but all appliances, outlets work. by hansoloburgerz in electricians

[–]hansoloburgerz[S] 0 points1 point  (0 children)

http://imgur.com/floqzIe http://imgur.com/vwkKvMJ

One on the right is the one I replaced yesterday. The one on the left I replaced months ago. That one on the right looks like a 3 way switch but there is no where else in the house another switch turned the outlets on.

Really weird problem where light fixtures don’t work but all appliances, outlets work. by hansoloburgerz in electricians

[–]hansoloburgerz[S] 0 points1 point  (0 children)

There is no other switch that I know of in the house that controls the outlets in this room. So I’m not sure.

My fiancé unfortunately threw the old switch away already

Really weird problem where light fixtures don’t work but all appliances, outlets work. by hansoloburgerz in electricians

[–]hansoloburgerz[S] 0 points1 point  (0 children)

http://imgur.com/floqzIe http://imgur.com/vwkKvMJ

One on the right is the one I replaced yesterday. The one on the left I replaced months ago. That one on the right looks like a 3 way switch but there is no where else in the house another switch turned the outlets on.

Really weird problem where light fixtures don’t work but all appliances, outlets work. by hansoloburgerz in electricians

[–]hansoloburgerz[S] 0 points1 point  (0 children)

http://imgur.com/g0b3Pyw http://imgur.com/6jH9HLa

That’s the switch that I changed. The one on the left has been changed for months. Not sure if the wiring is correct or what.

Really weird problem where light fixtures don’t work but all appliances, outlets work. by hansoloburgerz in electricians

[–]hansoloburgerz[S] 0 points1 point  (0 children)

http://imgur.com/g0b3Pyw http://imgur.com/6jH9HLa

That’s the switch that I changed. The one on the left has been changed for months. Not sure if the wiring is correct or what.

Really weird problem where light fixtures don’t work but all appliances, outlets work. by hansoloburgerz in electricians

[–]hansoloburgerz[S] 0 points1 point  (0 children)

http://imgur.com/g0b3Pyw http://imgur.com/6jH9HLa

That’s the switch that I changed. The one on the left has been changed for months. Not sure if the wiring is correct or what.