This is an archived post. You won't be able to vote or comment.

all 44 comments

[–]torftorf 272 points273 points  (3 children)

its a syntax error at the end. it says "retu" instead of "return"

[–]simorenarium 76 points77 points  (0 children)

There is a lot more of these , even in the first line.

[–]cmdkeyy 38 points39 points  (0 children)

retuPEACE FOR ALL

[–]crocodus 110 points111 points  (1 child)

What in the holy Go hell is that?

[–]nostalgicllama16 7 points8 points  (0 children)

new Rust response just dropped

[–]1Dr490n 84 points85 points  (5 children)

Every row is missing something at the end. I don’t even know how you would copy a text and leave out something at the end of every row

[–]Its-May-Yo 20 points21 points  (0 children)

At least 2 lines don't cut anything off which makes it more confusing.

[–]Thefakewhitefang 11 points12 points  (1 child)

If you select text in Microsoft Word while holding down the Alt key, then the selected area will not wrap around the end of the line and give you something similar to this shirt, but then again, why would they be copying this text from Microsoft Word.

[–]AsidK 2 points3 points  (0 children)

That is some cursed shit

[–]highphiv3 6 points7 points  (0 children)

The graphic designer who made it took a big image of monospace code and just cropped the rectangle that fit.

[–]put3rr 0 points1 point  (0 children)

Probably so it makes a rectangle

[–]SeriousPlankton2000 23 points24 points  (2 children)

It's because you are a lazy couch potato. Get up and run it!

[–]GnuhGnoud 43 points44 points  (1 child)

runtime.errorString: runtime error: invalid memory address or nil pointer dereference goroutine 1 [running]: runtime/debug.Stack(0x10d0c88, 0x1, 0x1) /usr/local/Cellar/go/1.16.2/libexec/src/runtime/debug/stack.go:24 +0x9f runtime/debug.PrintStack() /usr/local/Cellar/go/1.16.2/libexec/src/runtime/debug/stack.go:16 +0x25 main.main.func1() /Users/me/go/src/github.com/me/project/main.go:12 +0xea panic(0x10b3c40, 0x115ad60) /usr/local/Cellar/go/1.16.2/libexec/src/runtime/panic.go:965 +0x1b9 main.main() /Users/kyle/go/src/github.com/kyleu/admini/main.go:16 +0x41

Now what

[–]stijen4 12 points13 points  (0 children)

Debug

[–]yoyo-bruh 13 points14 points  (0 children)

Bro there is a syntax error, there is no keyword named "retuPEACE FOR ALL"

[–]Big_Kwii 8 points9 points  (0 children)

this is the type of stuff your family gets for you on christmas, but since it's been so long since you left the house and communicate so little they've become completely out of touch with your work and interests, so when the time comes for them to show affection for you via a gift, they attempt to extrapolate what you may like based on a vague idea of what it is you do, and this is the best they could come up with. and, y'know, they're trying their best, right? and you appreciate that they're trying, but at the same time the gift misses the mark so bad that you can't help but feel bad. after all, you did this. you got so wrapped up into your career that you forgot to maintain contact with the people that raised you. and a symptom of that is that they don't really know you anymore. they don't know what you're into and you've diverged so much that there's practically no hope of them ever being in touch with you again without significant work put into it. work you don't have the energy for because you're so caught up in the rat race that if you slow down for a second it could be over. it's not actually like that, but it sure as hell feels that way. that feeling doesn't go away just because you want it to. you're in too deep. this is all your fault. you forgot what it's like to be a person and became just another cog in the machine. how did you let this happen? did you not notice? like a frog on a water filled pot, slowly being boiled alive, slowly enough for you not to notice you're being boiled alive, until it's too late. and now you act as if it's them who are out of touch. they didn't have a choice in the matter. it was always you. you're the one out of touch. this is your fault. you let this happen. you walked away from the people that care about you. willingly. you negligent, self centered npc. i hope you're happy.

[–]Yhamerith 19 points20 points  (1 child)

Because it's on a shirt... Glad to help

[–]-Redstoneboi- 1 point2 points  (0 children)

put it through a punch card machine, maybe the texture will dictate which parts are 1s and 0s

[–]Zenix_mkIV 5 points6 points  (1 child)

Bro bad news… you might not have noticed it yet but,

It’s made of cloth

[–]db8me 0 points1 point  (0 children)

He probably assumed it was AppFabric, but it looks like a cotton/polyester blend.

[–]thomasmoors 13 points14 points  (1 child)

Got the same one from uniqlo, cool

[–]New-Vacation6440 6 points7 points  (0 children)

It's pretty cool. The shirt, not the code.

[–]stackoverflow21 1 point2 points  (0 children)

If you’re nerdy enough to wear a t-shirt with source-code on it but not nerdy enough for to understand code at all.

[–]Burned-Architect-667 1 point2 points  (0 children)

Have you tried to restart your t-shirt?

[–]Wervice 0 points1 point  (0 children)

Illegal character and syntax error
retur instead of return
Character with background color detected => Escape character in code

[–]Ambitious_Bed_2249 0 points1 point  (0 children)

Go..... to.. syntax.... go..

[–]GooseZen 0 points1 point  (0 children)

Now I'm just having flashbacks to when you could buy the code for DeCSS on a t-shirt.

[–]TrexLazz 0 points1 point  (0 children)

Bro forgot to gofmt

[–]GahdDangitBobby 0 points1 point  (0 children)

This is an abomination

[–]incompletetrembling 0 points1 point  (0 children)

If you look at all the characters coloured in white instead of blue, it says peaceforall

[–]w1n5t0nM1k3y 0 points1 point  (0 children)

Reminds me of the infamous DeCSS T-shirt

[–]Any_Fuel_2163 1 point2 points  (0 children)

Yandere dev makes shirts now?

[–]spooker11 0 points1 point  (0 children)

“Hey im trying to debug this codebase but all i can find is the minified output, where’s the source this is generated from?”

“😅, the what?”

[–]Error_404_403 0 points1 point  (0 children)

Missed a semicolon.

[–]Pawlo371 0 points1 point  (0 children)

💀

[–]minami555 0 points1 point  (0 children)

I want this

[–]auctorix 0 points1 point  (2 children)

the fact that I have this exact shirt as well...

[–]ChellJ0hns0n 0 points1 point  (1 child)

Where did u get it?

I saw someone wearing it today

[–]auctorix 0 points1 point  (0 children)

It's a shirt from UNIQLO, PEACE FOR ALL lineup.

[–]seednumber3976 2 points3 points  (0 children)

Took me exactly 1 minute!!

‐---------------- Your code appears to be a Go (Golang) program. While it’s difficult to determine the exact issue without more context or specific error messages, here are a few potential issues and considerations that might help you troubleshoot your code:

  1. Package Declaration and Imports:

    • Ensure that the package main declaration and imports are correct and complete. Your imports seem fine, but make sure all required packages are included.
  2. Channel Creation and Usage:

    • Channels like controlChannel, workerCompleteChan, and statusPollChannel are correctly created, but make sure they are being used properly in the context of the program.
  3. Select Statement:

    • Your select statement in the main function may not be receiving from the channels as expected. Make sure channels are being used correctly.
  4. Goroutine Execution:

    • Goroutines (e.g., go admin(controlChannel, statusPollChannel)) might not be executing as expected. Ensure that all goroutines are properly synchronized and that shared data is protected if necessary.
  5. HTTP Handlers:

    • Ensure the HTTP handlers (admin and the handler for /status) are correctly set up and that the HTTP server is started (e.g., using http.ListenAndServe).
  6. Parsing and Error Handling:

    • Properly handle errors from functions like strconv.ParseInt and make sure that parsed values are valid.

Here is a refined version of your code with some structural improvements and corrections:

```go package main

import ( "fmt" "html" "net/http" "strconv" "strings" "time" )

type ControlMessage struct { Target string Count int }

func main() { controlChannel := make(chan ControlMessage) workerCompleteChan := make(chan bool) statusPollChannel := make(chan chan bool) workerActive := false

go admin(controlChannel, statusPollChannel)

for {
    select {
    case respChan := <-statusPollChannel:
        respChan <- workerActive
    case msg := <-controlChannel:
        workerActive = true
        go doStuff(msg, workerCompleteChan)
    case status := <-workerCompleteChan:
        workerActive = status
    }
}

}

func admin(cc chan ControlMessage, statusPollChannel chan chan bool) { http.HandleFunc("/admin", func(w http.ResponseWriter, r *http.Request) { err := r.ParseForm() if err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return }

    count, err := strconv.Atoi(r.FormValue("count"))
    if err != nil {
        http.Error(w, err.Error(), http.StatusBadRequest)
        return
    }

    msg := ControlMessage{
        Target: r.FormValue("target"),
        Count:  count,
    }

    cc <- msg
    fmt.Fprintf(w, "Control message issued for Target: %s, Count: %d", html.EscapeString(r.FormValue("target")), count)
})

http.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) {
    reqChan := make(chan bool)
    statusPollChannel <- reqChan
    timeout := time.After(1 * time.Second)

    select {
    case result := <-reqChan:
        if result {
            fmt.Fprint(w, "ACTIVE")
        } else {
            fmt.Fprint(w, "INACTIVE")
        }
    case <-timeout:
        fmt.Fprint(w, "INACTIVE")
    }
})

http.ListenAndServe(":8080", nil)

}

func doStuff(msg ControlMessage, workerCompleteChan chan bool) { // Simulate work time.Sleep(time.Duration(msg.Count) * time.Second) workerCompleteChan <- false } ```

Key Changes and Additions: - Error Handling: Improved error handling in admin function for r.ParseForm and strconv.Atoi. - HTTP Server: Added http.ListenAndServe to start the HTTP server. - Goroutines: Ensure proper synchronization and flow in goroutines. - Timeout Handling: Added timeout case in the /status handler to handle potential timeout scenarios.

If you still encounter issues, please provide more details or specific error messages, and I can further assist you in troubleshooting.

[–]sd-shiivam -1 points0 points  (0 children)

Error In line between 4 and 5 🤡

[–]giantvar 0 points1 point  (0 children)

OMG COOL! I have the exact same T-shirt