This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/token" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://go.dev/play/p/CxJf4Jf9rDZ | |
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
const ZZZZ = 18279 + 456975 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Should be a job too :-D | |
# With xargs (on all namespaces) | |
kc get jobs -o=jsonpath='{range .items[?(@.status.conditions[0].type == "Failed")]}{.metadata.name}{"\t"}{.metadata.namespace}{"\n"}{end}' --all-namespaces | \ | |
xargs -n2 sh -c 'kubectl delete jobs $0 --namespace=$1' | |
# For loop (only in the current namespace) | |
for i in $(kc get jobs -o=jsonpath='{range .items[?(@.status.conditions[0].type == "Failed")]}{.metadata.name}{"\n"}{end}'); | |
do kubectl delete jobs $i; done |
From https://stackoverflow.com/questions/47134293/compare-structs-except-one-field-golang
One option would be to group fields that should take part in the comparison into a different struct which you can embed in your original. When doing the comparison, just compare the embedded fields:
type Person struct {
Name string
Age int
}
- Is GraphQL Still Relevant in an HTTP2 World?
- GraphQL Is a Trap?
- Vulcain Comparison with GraphQL and Other API Formats
- How Multiplexing Changes Your HTTP APIs
- GraphQL kinda sucks
- Let's Stop Building APIs Around a Network Hack
- Does HTTP Multiplexing Make GraphQL Obsolete?
- GraphQL OpenAPI
- GraphQL vs gRPC
In Go, usually an HTTP client is:
type doer interface {
Do(req *http.Request) (*http.Response, error)
}
Go's HTTP situation is that the http.RoundTripper
interface is explicitly designed to provide customization of how an HTTP request executes,as that's exactly what it's there for.
If you take a look at the definition of RoundTripper and compare it to the doer
interface above, I think you'll see that the similarity is striking:
In a Five Room Dungeon, the basic formula is:
- Entrance or Guardian
- Puzzle or Roleplaying Challenge
- Trick or Setback
- Climax, Big Battle, or Conflict
- Reward, Revelation, or Plot Twist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/lf-edge/eve-libs/blob/main/reconciler/README.md | |
https://github.com/spotahome/gontroller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gets the latest Apollo Embedded Sandbox Playground URL from the CDN S3 bucket | |
// | |
// To get the Subresource Integrity check, `go run main.go` and take what that outputs and run like this: | |
// CDN_FILE=https://embeddable-sandbox.cdn.apollographql.com/58165cf7452dbad480c7cb85e7acba085b3bac1d/embeddable-sandbox.umd.production.min.js | |
// curl -s $CDN_FILE | openssl dgst -sha256 -binary | openssl base64 -A; echo | |
package main | |
import ( | |
"encoding/xml" |