All of the following information is based on go version go1.8.3 darwin/amd64.
(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)
androiddarwin
| /* | |
| Author: https://github.com/gorhill | |
| Source: https://gist.github.com/gorhill/5285193 | |
| A Go function to render a number to a string based on | |
| the following user-specified criteria: | |
| * thousands separator | |
| * decimal separator |
| using Foundation; | |
| using UIKit; | |
| namespace YourApp | |
| { | |
| [Register ("AppDelegate")] | |
| public partial class AppDelegate : UIApplicationDelegate | |
| { | |
| NSObject _screenshotNotification = null; |
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)| package main | |
| // #include <stdlib.h> | |
| // #include "wrapper.c" | |
| import "C" | |
| import "unsafe" | |
| import "fmt" | |
| func read(filename string) string { | |
| f := C.CString(filename) |
These are the steps I went through to set up an SSL cert. Purchase the cert
Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:
openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
| package main | |
| import ( | |
| "net/http" | |
| ) | |
| func redirect(w http.ResponseWriter, req *http.Request) { | |
| http.Redirect(w, req, | |
| "https://" + req.Host + req.URL.String(), | |
| http.StatusMovedPermanently) | |
| } |
| // Package deepcopy provides a function for deep copying map[string]interface{} | |
| // values. Inspired by the StackOverflow answer at: | |
| // http://stackoverflow.com/a/28579297/1366283 | |
| // | |
| // Uses the golang.org/pkg/encoding/gob package to do this and therefore has the | |
| // same caveats. | |
| // See: https://blog.golang.org/gobs-of-data | |
| // See: https://golang.org/pkg/encoding/gob/ | |
| package deepcopy |
| == Visual Studio .NET 2003 (DO NOT COPY THIS LINE) == | |
| Microsoft Visual Studio Solution File, Format Version 8.00 | |
| # Visual Studio .NET 2003 | |
| VisualStudioVersion = 7.1 | |
| == Visual Studio 2005 (DO NOT COPY THIS LINE) == | |
| Microsoft Visual Studio Solution File, Format Version 9.00 | |
| # Visual Studio 2005 | |
| VisualStudioVersion = 8.0 |