Working with time in Go is pretty straightforward.
Get the current local time:
now := time.Now() // 02 Apr 15 14:03
Construct a time with Date(y, m, d, h, m, s, ns, loc):
| package main | |
| import ( | |
| "io" | |
| "log" | |
| "net" | |
| "time" | |
| ) | |
| func reader(r io.Reader) { |
| # -*- coding: utf-8 -*- | |
| """ | |
| Upload folder to Google Drive | |
| """ | |
| # Enable Python3 compatibility | |
| from __future__ import (unicode_literals, absolute_import, print_function, | |
| division) |
| package main | |
| import ( | |
| "fmt" | |
| "gopkg.in/mgo.v2" | |
| "gopkg.in/mgo.v2/bson" | |
| "time" | |
| ) | |
| type Content struct { |
Working with time in Go is pretty straightforward.
Get the current local time:
now := time.Now() // 02 Apr 15 14:03
Construct a time with Date(y, m, d, h, m, s, ns, loc):
# 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 timestamp | |
| import ( | |
| "fmt" | |
| "labix.org/v2/mgo/bson" | |
| "strconv" | |
| "time" | |
| ) | |
| type Timestamp time.Time |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net" | |
| "net/mail" | |
| "net/smtp" | |
| "crypto/tls" | |
| ) |
| /* --- Usage --- */ | |
| g++ server.c -o server | |
| g++ client.c -o client | |
| ./server | |
| ./client 127.0.0.1 | |
| /* --- server.c --- */ | |
| #include <sys/socket.h> | |
| #include <netinet/in.h> | |
| #include <arpa/inet.h> |
| /*! SET storage_engine=INNODB */; | |
| DROP TABLE IF EXISTS accounts; | |
| CREATE TABLE accounts ( | |
| record_id int(11) unsigned NOT NULL AUTO_INCREMENT, | |
| id char(36) NOT NULL, | |
| external_key varchar(128) NULL, | |
| email varchar(128) NOT NULL, | |
| name varchar(100) NOT NULL, | |
| first_name_length int NOT NULL, |
| package main | |
| import ( | |
| "fmt" | |
| "labix.org/v2/mgo" | |
| "labix.org/v2/mgo/bson" | |
| "time" | |
| ) | |
| type Person struct { |