Description: This function is used to write a response body to the HTTP request. It takes a string as its argument and sends it as the response content to the client. Example in JavaScript:
write("Hello, World!");| func Parallel(workers int, f func()) { | |
| wg := &sync.WaitGroup{} | |
| for i := 0; i < workers; i++ { | |
| wg.Add(1) | |
| go func() { | |
| defer wg.Done() | |
| f() | |
| }() | |
| } |
| func TestEjemploGoParaAllan(t *testing.T) { | |
| b := NewBox() | |
| db := &Database{} | |
| b.HandleResourceNotFound = func(w http.ResponseWriter, r *http.Request) { | |
| w.WriteHeader(http.StatusNotFound) | |
| w.Write([]byte("HEY! Not Found")) |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "log" | |
| "net" | |
| "strings" | |
| "github.com/fulldump/goconfig" |
| package placeholders | |
| import ( | |
| "regexp" | |
| "strings" | |
| ) | |
| var placeholders = regexp.MustCompile(`{{([^}]*)}}`) | |
| func Traverse(input string, callback func(string) string) (output string) { |
| // POST /notes | |
| let a = auth(); | |
| let user_id = a.user.id; | |
| // inception credentials | |
| let credentials = { | |
| "database_id": "0629698a-2de5-491a-852a-8041e3fa5dd4", | |
| "api_key": "dd38017d-8d8d-40a7-88bf-3141e03355b5", | |
| "api_secret": "616ca676-b3e5-4a8a-a725-b03417f5362b" |
| package openapi | |
| import ( | |
| "context" | |
| "net/http" | |
| "reflect" | |
| "strings" | |
| "github.com/fulldump/box" | |
| ) |
| package main | |
| import ( | |
| "crypto/tls" | |
| "encoding/json" | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "net/http" | |
| "net/url" |
| <div>Hello world</div> |
| package manipulator | |
| import ( | |
| "fmt" | |
| "reflect" | |
| "strings" | |
| ) | |
| type Manipulator struct { | |
| any |