Skip to content

Instantly share code, notes, and snippets.

View chris001177's full-sized avatar

Chris chris001177

  • india
View GitHub Profile

Read struct tags

package main

import (
	"fmt"
	"reflect"
)

Arithmetic

Operator Description
+ addition
- subtraction
* multiplication
/ quotient
% remainder
& bitwise and
| bitwise or
package main
import (
"net/http"
"github.com/labstack/echo"
)
func main() {
e := echo.New()
package main
import (
"net/http"
"strconv"
"sync"
"time"
"github.com/labstack/echo"
)
package main
import (
"fmt"
"gopkg.in/robfig/cron.v2"
"time"
)
func main() {
package main
import (
"context"
"flag"
"log"
"os"
"os/signal"
"strings"
"sync"
func main() {
emp1 := Emp{"E-1", "Anupam", "Raj", 20}
emp2 := Emp{"E-2", "Rahul", "Anand", 30}
createEmp(emp1)
fmt.Println(getEmps())
createEmp(emp2)
fmt.Println(getEmps())
emp3 := Emp{"E-1", "Rahul", "Anand", 30}
updateEmp(emp3)
fmt.Println(getEmps())
package main
import (
"fmt"
"github.com/gocql/gocql"
)
var Session *gocql.Session
CREATE KEYSPACE = test
WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
CREATE TABLE emps (
empid text PRIMARY KEY,
first_name text,
last_name text,
age int
);
package main
import (
"fmt"
"net/http"
sarama "gopkg.in/Shopify/sarama.v1"
)
func main() {