go: unknown revision of workspace module
I have a common-libs
repo which consists of some shared code. It is structured using go workspaces and the file structure looks like this:
How to skip a package-level example in Go?
I have a package level example which I would like to skip running if an environmental variable is not provided. If I just return from it, then output does not match the expected output and when it runs as a test, the test fails.
How to use maths as package in main file in golang
I have a Golang folder with test.go file that contains main function and part of package main. Now I have a subfolder, sibling of test.go named maths which contain a add.go file. Now I want to know how can i get this add method from maths folder to test.go to execute.
How to translate arabic names to unicode in Go
I’m working on a code to translate arabic name to Unicode in Go. I need a function that can normalize different languages to unicode.
XOR byte encryption in Go
I’m trying to encrypt my bytes using XOR, based on a Java code:
Optimizing Memory Allocation in Packet Encryption
I have a code that is allocating a certain amount of memory: 192 B/op, and I’m thinking, maybe it’s allocating memory in a dumb way, this is the function:
About the inability to encrypt statically compiled files in Linux
I use vmpsoft to encrypt golang binary files, but it prompts: “file golangfile has an unsupported subsetsp”
Assigning value to interface argument using DoAndReturn
I have the following method:
Go test mock cron job
To mock the cron job( robfig cron ) or to assert the job was invoked at least once from the func abc(). When running the test, it calls the real cron job and waits till the schedule starts.
Updating a slice from a goroutine
I’m having trouble trying to work out how to update a slice from parallel goroutines. I initially came up with this code (that I knew wasn’t the correct way to do it!):