You can post a json file with curl
like so:
curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION
so for example:
OUT := binariy-name | |
PKG := gitlab.com/group/project | |
VERSION := $(shell git describe --always --long --dirty) | |
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/) | |
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/) | |
all: run | |
server: | |
go build -i -v -o ${OUT} -ldflags="-X main.version=${VERSION}" ${PKG} |
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"regexp" | |
"time" | |
) |
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/go-ldap/ldap/v3" | |
) | |
const ( |
package main | |
import ( | |
"context" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"os" | |
"strings" | |
"text/tabwriter" |
You are working on a Rails app that uses a gem named abc
. This gem is hosted on RubyGems and the source code of the gem is available at https://github.com/your-username/abc.
You created a new branch locally for your gem (new-feature
). You wanted to modify the gem and load it directly to your local Rails app. And, you don't want to push the gem changes to GitHub and publish the gem to RubyGems just yet.
You want all the changes that you made in your local gem directory get reflected immediately in your local Rails app without requiring you to run gem build
and gem install
command in the gem's local directory.
package main | |
import "fmt" | |
func uniqueNonEmptyElementsOf(s []string) []string { | |
unique := make(map[string]bool, len(s)) | |
us := make([]string, len(unique)) | |
for _, elem := range s { | |
if len(elem) != 0 { | |
if !unique[elem] { |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net" | |
"net/http" | |
"os" | |
"time" | |
) |
package main | |
import ( | |
"fmt" | |
"github.com/vmware/govmomi" | |
"github.com/vmware/govmomi/vim25/mo" | |
"github.com/vmware/govmomi/vim25/types" | |
"net/url" | |
) | |