/go/ - Go Programming General

What have you been working on? Share recent projects, ask questions, and talk about anything related to Go or Plan 9.

>Go Resources:
>golang.org/
>golang.org/doc/
>gopl.io/
>go-lang.cat-v.org/

>This thread was brought to you by Thompson, Pike, Griesemer, and Kernighan

Attached: goph.png (542x550, 355K)

Other urls found in this thread:

github.com/gen0cide/gscript
defcon.org/html/defcon-26/dc-26-speakers.html#Levinson
mc.deadbeef.codes
github.com/ahhh/gscripts
lockboxx.blogspot.com/2018/05/gscript-examples-with-att.html
blog.golang.org/errors-are-values
code.9front.org/hg/plan9front
twitter.com/SFWRedditVideos

Get yourself and that retarded looking hamster of of here.

>newer Go releases have issues compiling on 9front
lol

Trying to learn it slowly. It would be my first real language. I do literally everything in Powershell dabbled in JavaScript but I learn best by doing. I play around a lot with restful API's so I wanted to try in GO just seemed to be too much of a brainlet to get it.

>using goimports
>do not have to manage my imports at all, the tool does it for me
Go's tooling makes other languages a joke.

why don't you Go fuck yourself lol

>built-in testing, benchmarking, sample profiling, tracing, race detector and build tool
comfy as fuck

>>This thread was brought to you by Thompson, Pike, Griesemer, and Kernighan
>no mention of Cox
Who do you think you are

anyone uses this for computer vision? like gocv

based

No. I mainly do web services.

Haven't found a use-case for now, but I'm eager to try it out once I find a sufficient reason to.
Currently C/Lua/Shell/Make are enough.

what IDE are you using?
im currently using vim-go, but i dont like it so far

Such an amazing language filled with innovation...

Just kidding you fucking faggot stop it with the meme languages

Visual Studio Code has really good official plugin for Go, haven't seen anything that matches it

I use Intellij Idea. It's paid but worth it.

Alright, give me the low-down on Go. What's the strenghts and weaknesses, how does it fare in scientific computing (matrices, plotting of data..)?

From the perspective if an infosec professional that only writes small programs and script.


Easy to understand.
Concurrency.
Package management.


I'm seeing go used more and more in my industry. Currently python is the most popular but I can see go overtaking it pretty quickly here.

Why don't you Go ahead and suck my cock?
Sage

I want to git gud at excel. What are the best online materials you fellas would recommend?

>talk about anything related to Go or Plan 9
So, /comfy/ general?

Attached: comfy.jpg (409x409, 45K)

Jetbrains has a really nice plugin for Go, along with GoLand (go IDE). Recently switched from using Atom with go-plus.

Haven't tried any CV with it yet, actually. Wasn't aware of the gocv library, I'll have to check it out

Yeah, iirc you need to have a preexisting Go installation to compile newer Go versions past 1.8.

So on plan9, you'll actually have to build from source twice (once for bootstrap, then again for the latest release)

do you recommend a CV framework in particular?

That's how it works for any compiler that's written in its own language though.

Attached: gophers.png (427x180, 47K)

Fuck, I really need to get me some of that Race detector. Does it do niggers only or do they include other races too.

No, since all Go compilation is cross-compilation, you can compile the Go toolchain on Linux while targeting Plan 9 and then just copy it over with drawterm.
You don't need to bootstrap from some older Go version.

Same here

I've seen some really cool infosec stuff written in Go, lately. Check out github.com/gen0cide/gscript

There'll be a presentation on it soon, too: defcon.org/html/defcon-26/dc-26-speakers.html#Levinson

Exactly zero people will do this though

Go is just an awful language

Ok guys so I am appending text to a file, and I am using openfile(), and Fprintf, but my program tends to add quite a bit of text at short amount of time, and I am opening and closing the file quite a bit in a short amount of time. I am wondering what alternatives should I use so I am not constantly opening and closing the file to append to it, even though at times I get quite a bit of info to throw in there at once.

I hope that made sense.

I made a Mandelbrot set Google map on a kubernetes cluster: mc.deadbeef.codes

I've done it. Just Werks™.
Beats the hell out of cross compiling C on Unix (or god forbid Windows).
The user demographic around 9front the farthest from having trouble overcoming technical hurdles.

please stop splintering /dpt/ and shitting up the catalog

Was it a VM or a standalone Plan 9? How did you transfer the compiler?

I did it on a 9front VM, although I had run a 9front grid on real hardware before.
drawterm exposes the host system's fs on /mnt/term, and you can copy directories on Plan 9 with dircp(1).

Goph a cute.
A CUTE

Lmao no generics.

Attached: Screen Shot 2018-04-27 at 01.34.01.png (328x380, 155K)

What is the best memory editing library for Go

Attached: 1533084900846.jpg (800x1230, 165K)

memory editing?

Yes like RPM, WPM, etc

Go on, oldfag programmer of 10 years here. I have no idea what you are talking about.

Like ReadProcessMemory and WriteProcessMemory, opening handles, dll injection, etc

Ah yea, I've never done that in any lang. I must admit the most I use go for is automation (mainly in aws) and APIs. You could definitely include a malicious C payload with go-bindata that does. You could probably just include a C lib that does this in the go code anyways.

C

>expecting "our programmers are too stupid for java and c" gophers to understand memory

But I am that stupid, I probably could not figure out C if I tried

Gib generics pls

then you have no business editing memory
stick to making webshit CRUD APIs

Delusional

>>I've seen some really cool infosec stuff written in Go, lately. Check out github.com/gen0cide/gscript
That looks really interesting, do you have any more info on what it does? there is nothing in the readme

retard go fag cant even follow links in readme

That link is sparse too, faggot.

>what are gradle, maven, cargo, ant, pip...

Any good books on infosec that utilizes go for a newbie to infosec?

It's video game cheats dude nothing crazy

I like that there are no generics. Instead you can use reflection and take the route of static code generation. You get strong type safety for a little bit of extra boilerplate.

Its never been a real issue for me but I would like to have a clean simple C++ style templating system.

Go is easy, but if err nil spam is stupid.

It's an attack framework type of thing with an embedded JS runtime (V8). It allows you to easily package up + deploy multiple payloads and execute them concurrently, in their own little runtimes. You write these payloads in a slightly extended dialect of JS, compile them along with the GScript runtime into your payload, and deploy that using whatever vector you deem appropriate.

This has a lot of benefits incl making development/customization rapid and easy, prevents the failure of one payload from borking the rest, among other things. Keep an eye out for the upcoming defcon talk.

More info and examples here:
github.com/ahhh/gscripts
lockboxx.blogspot.com/2018/05/gscript-examples-with-att.html

No one uses standalone Plan 9, not even its developers. It doesn't even work anymore on bare metal since everyone only runs it in a VM no one notices if it breaks.

Errors are values. They can be programmed and made useful: blog.golang.org/errors-are-values

if err != nil actually happens far less often than you might think, and it's one of the first things covered in the linked blog post.

Thanks dude

Thanks for giving examples of other language's shitty tooling.

i am very gay and like penis in my butt

This language will dominate in the near future

Attached: 516R4ZoMqBL._SX402_BO1,204,203,200_.jpg (404x500, 35K)

This is like C but for apps, right?

Attached: gopher interface.png (1587x1587, 567K)

retard language, right up Jow Forumss alley.
No generics, shitty error handling, algol 68 tier feature set

Attached: goper brainlet.png (185x272, 6K)

>Go
>short limbs
>can't Go anywhere

that's not the issue, Go maintains the last release written in C for bootstrapping - this is actually great thing. But 9front needs some patches and those broke on new releases.

It's much easier to write python. Go is still missing generics and classes.

Attached: 1529752743667.jpg (700x963, 94K)

structural typing is so comfy

import "math"

type Shape interface {
Area() float64
}

type Square struct { // Note: no "implements" declaration
side float64
}

func (sq Square) Area() float64 { return sq.side * sq.side }

type Circle struct { // No "implements" declaration here either
radius float64
}

func (c Circle) Area() float64 { return math.Pi * math.Pow(c.radius, 2) }

It's a gopher dummy

Just keep the file descriptor open? Cache it.

Buffer your writes instead of writing small snippets. Then purge the buffer when the buffer fills

just use cpp if you want to hack gaymes

How did you handle errors in C already?

Untrue. 9front is in active development and has quite a few users running it on real hardware.
code.9front.org/hg/plan9front

I'm pretty sure Bell Labs' Plan 9 still has the odd user here and there as well.

>But 9front needs some patches and those broke on new releases.
Needed. The problem was fixed not too long ago.
And I'm pretty sure the issue was only on amd64.

C is worse
char *result;
if ((r = lib_func("param", 3, &result)) != STATUS_OK) {
return STATUS_ERR;
}
printf("%s\n", result);

>C is worse
Oh. Glad we came to the agreement that Go's error handling is OK then.

The absolutely pig disgusting for loops were a dealbreaker for me.

>Glad we came to the agreement that Go's error handling is OK then.
It's not, Go is just as shit. Explicit error checking is cancer.

>C is worse
>Go is just as shit
The anti-Go shill brain

You're replying to two different persons, smartass.

Not to mention the non sequitur of asserting that since B is shit, A must be good or ok.

>explicit error checking is cancer
You should be doing it constantly anyways.

?

Or, you know, just use a programming language and runtime that isn't designed by boomer Unix dinosaurs.

Wrapping everything in 14 layers of exception blocks is no more elegant and infinitely harder to debug.

exceptions have built in stack traces tho

>Wrapping everything in 14 layers of exception blocks is no more elegant and infinitely harder to debug.
Well, 14 layers of try catch is obviously bad design by any standard, but as say, you usually have the backtrace in the form of stack frames and can easily find out where the exception was thrown originally.

Youre also having to sift through the entire stack to find which little bit caused the error since you naturally just slap a "throws" in the signature or wrap most of the function inside of it.
Theres literally nothing wrong with immediate error handling over exceptions, especially because if youre not an oaf you can skip the individual error checks you know are going to be safe.
Error checking always sucks and theres no "better" solution over the other.

>Youre also having to sift through the entire stack
No, the place where the error was thrown is at the top.

>Theres literally nothing wrong with immediate error handling over exceptions,
There's literally everything wrong with it. First of all, exceptions means that your compiler is allowed to implicitly optimise for the successful code branch (instead of you needing to annotate "likely" and "unlikely" in every condition). Secondly, the code is a lot easier to read. Thirdly, if combined with RAII, you can make safer resource management.

You make code faster by writing faster code. Depending on the compiler to be smart enough to optimize for you isn't going to accomplish anything.

>You make code faster by writing faster code. Depending on the compiler to be smart enough to optimize for you isn't going to accomplish anything.
It accomplishes readable code, and allows the compiler to make smart choices on different architectures. This is the purpose of using "likely" and "unlikely" annotations in your C code to begin with.

When it comes to branch optimization, it makes a big difference. Obviously, algorithm makes a bigger difference but when you are comparing features you hold all other factors constant in the equation so you do not commit any correlation fallacies. In other words, we assume that the go language and other language (presumably c++) implemented the same algorithm as closely as possible. You find that the error checking has performance disadvantages due to the constant branching from the error checking. Lerk moar and learn to think rationally.

Attached: You.png (645x729, 56K)

good goy

You just assign err to _