All of the following information is based on go version go1.17.1 darwin/amd64.
| GOOS | Out of the Box |
|---|---|
aix |
✅ |
android |
✅ |
| Using MongoDB in golang with mgo |
| package com.pascalwelsch.utils; | |
| import android.support.annotation.Nullable; | |
| import android.support.v7.util.DiffUtil; | |
| import android.support.v7.widget.RecyclerView; | |
| import java.util.ArrayList; | |
| import java.util.Collections; | |
| import java.util.Comparator; | |
| import java.util.List; |
| /* | |
| C socket server example, handles multiple clients using threads | |
| Compile | |
| gcc server.c -lpthread -o server | |
| */ | |
| #include<stdio.h> | |
| #include<string.h> //strlen | |
| #include<stdlib.h> //strlen | |
| #include<sys/socket.h> |
| /* | |
| Usage: go run main.go < /path/to/private-key.xml | |
| Optionally takes base64 encoded input. | |
| This is a very crude implementation. Any errors result in a panic. | |
| */ | |
| package main | |
| import ( |
| package main | |
| import ( | |
| "fmt" | |
| "gopkg.in/mgo.v2" | |
| "gopkg.in/mgo.v2/bson" | |
| ) | |
| func main() { | |
| session, err := mgo.Dial("localhost") | |
| if err != nil { |
| These commands are based on a askubuntu answer http://askubuntu.com/a/581497 | |
| To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below. | |
| USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING. | |
| ABSOLUTELY NO WARRANTY. | |
| If you are still reading let's carry on with the code. | |
| sudo apt-get update && \ | |
| sudo apt-get install build-essential software-properties-common -y && \ | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ |
| """Provide high-level UDP endpoints for asyncio. | |
| Example: | |
| async def main(): | |
| # Create a local UDP enpoint | |
| local = await open_local_endpoint('localhost', 8888) | |
| # Create a remote UDP enpoint, pointing to the first one |
| package main | |
| import ( | |
| "context" | |
| "encoding/base64" | |
| "flag" | |
| "fmt" | |
| "log" | |
| container "google.golang.org/api/container/v1beta1" |