Building a central Go modules repository: GoCenter’s back to the future
Building a central Go modules repository: GoCenter’s back to the future. @jfrog @ankushchadha111 GopherCon 2019 Lightning Talk Ankush Chadha About me • Dev Manager, Community & Partner Engineering0 码力 | 19 页 | 9.22 MB | 1 年前3The Go frontend for GCC
other complex state- ments. This version of GOGO is eventually converted to GENERIC and passed to gcc’s middle-end. The main structures in GOGO are as follows: • Gogo. The IR for the entire input. • Statement object: a function, variable, type, constant, or package. Each of these structures is a class in gccgo’s source code. The Statement, Expression and Type classes are base clases with pure virtual functions creates a IR node representing an undetermined result. After parsing is complete, all the names are de- fined (an undefined name is an error) and a lowering pass converts the undetermined nodes to the appropriate0 码力 | 14 页 | 122.25 KB | 1 年前32.6 Go in Linux Desktop Environment
夏彬 武汉深之度 Linux桌面环境 Gnome (Gtk) KDE (Qt) Lxde (Gtk) LxQt(Qt5) Xfce (Gtk) DDE (Gtk) ....... DE组件 Windows Manager Input Method Launcher Panel (dock) Session Manager Appearance Configure Modules 编译型语言相对来说更适合长期项目 Question: DE是否应该努力追求本身独立? 可以跑在更多发行版上 更多的受众,更多的反馈 但DE最终会与底层服务甚至特定版进行交互,完全独立很难走到完美。 造成更多的开发包袱 Linux不会被统一,所以DE最好还是拥有更好的内聚性。 但应该打包更多的系统在一起, 从更多的地方优化用户体验,无折腾。 基础文件系统 + 仓库 + DE + 软件商店(各种应用软件才是正常用户需要的 //#include//#include import "C" import "fmt" func main() { s := C.time(nil) C.srandom(C.uint(s)) r := C.random() fmt.Println(r) } Run CGO Tips: Even more convenient than 0 码力 | 36 页 | 414.50 KB | 1 年前3Go on GPU
Go on GPU. GopherChina 2023. Session "Foundational Toolchains" Go on GPU Changkun Ou changkun.de/s/gogpu GopherChina 2023 Session “Foundational Toolchains” 2023 June 10 1 Changkun Ou. 2023. "Foundational Toolchains" Preparation: Driver - Metal as Example package mtl // import "changkun.de/x/gopherchina2023gogpu/gpu/mtl" /* #cgo CFLAGS: -Werror -fmodules -x objective-c #cgo LDFLAGS: GopherChina 2023. Session "Foundational Toolchains" Example 1: Matrix Multiplication import "changkun.de/x/gopherchina2023gogpu/gpu/mtl" // Metal driver var ( //go:embed mul.metal mulMetal string0 码力 | 57 页 | 4.62 MB | 1 年前3Golang Manual By AstaXie-20120522
about installing gccgo, see Setting up and using gccgo. Download the Go tools Visit the Go project's downloads page and select the binary distribution that matches your operating system and processor architecture go hello, world If you see the "hello, world" message then your Go installation is working. What's next Start by taking A Tour of Go. For more detail about the process of building and testing Go programs Tutorial. Read Effective Go to learn about writing idiomatic Go code. For the full story, consult Go's extensive documentation. Subscribe to the golang-announce mailing list to be notified when a new stable0 码力 | 6205 页 | 12.83 MB | 1 年前3Casdoor · An Open Source UI-first Identity Access Management (IAM) / Single-Sign-On (SSO) platform supporting OAuth 2.0, OIDC, SAML and CAS
client_id=xxx&response_type=code&redirect_uri=xxx&scope=read&state=xxx . Replace endpoint with your Casdoor's host URL and xxx with your own information. HINTS HINTS How to fill out the xxx parts? • For client_id under each individual Application • For redirect_uri : you should set this to your own Application's callback URL. Casdoor will use this information to send the response back after authorization. • For to your Application: "You know what, this code seems legit. You must be the right Application. Here's the access_token for you." With this code , Casdoor confirms that it is an authorized Application (authorized0 码力 | 825 页 | 58.31 MB | 1 年前3Golang to the rescue - Saving DevOps from TLS turmoil
by Gopherize.me (https://gopherize.me/) Not Too Long Ago in a Place of Work Far, Far Away... Let's Talk Certi�cate Chains 2 Chainz (we can talk rap music later) This is the Goal NBD ... OMG So What certi�cate authority, the certFile should be the concatenation of the server's certi�cate, any intermediates, and the CA's certi�cate." Gopher Inclusion by Ashley McNamara (https://github.com/ashleymcnamara/gophers) main: mux, cfg, srv Code creates a mux, short for HTTP request multiplexer I ❤ multiplexers (it's a long story that involves analog signals) mux has a function that creates an HTTP server with headers0 码力 | 20 页 | 6.28 MB | 1 年前3Secure access to EC2 (for developers)
weak-password attacks – bots and scanners – DDoS attacks A regular virtual machineIt's a VM. Classic EC2 instance in de‐ fault setting. Resources: EC2SecurityGroup: Type: AWS:: EC2:: SecurityGroup can see here, we have regular CloudFormation setup, which many of de‐ velopers just produce. In 4 words - "it is not good" So that's the story about secured SSH server.Simple fix Resources: EC2SecurityGroup: secure our host properly – and as a good thing, we can delegate it to provider – unfortunately, it's not free about services – EC2 Instance Connect is most cost efficient – SSM is most flexible solution0 码力 | 10 页 | 3.11 MB | 5 月前3Go 1.18 中的泛型
Go 1.18 中的泛型 欧长坤 changkun.de/s/generics118 2022/03/30 1 语法和使用 2 什么时候需要泛型? 3 当使用接口作为函数的形参类型时,函数调用方传递的实际参数可以是完全不同的 类型: type T interface { Add(T) T } func Sum(elems ...T) (sum T) { // T 可以是任何实现 Add(v) } return } 当使用类型参数作为函数的形参类型时,函数调用方传递的实际参数必须是满足类型参数所约束的类型: func GenericSum[S ~int](elems ...S) (sum S) { // S 的底层类型必须底层类型为 int 约束的类型 for i := range elems { sum += elems[i] } return } 类型安全的参数传递,以及对实现的类型进行抽象 具有类型参数 (Type Parameter) 的签名 4 func F[T C](v T) (T, error) 普通参数列表 返回值列表 类型参数 类型集(约束) type S[T C]struct 类型参数 类型集(约束) 类型参数列表 类型参数的声明紧随:1)函数名之后,或者 2)类型名之后。类型参数通过类型集进行约束。 类型集 (Type Set) 的定义0 码力 | 45 页 | 501.50 KB | 1 年前3对 Go 程序进行可靠的性能测试
对 Go 程序进行可靠的性能测试 Changkun Ou https://changkun.de/s/gobench/ Go 夜读系列 |talkgo.org|Talk Go|第 83 期 March 26, 2020 # Go 1.13 / 1.14 2020 © Changkun Ou · Go 夜读 · 对 Go 程序进行可靠的性能测试 主要内容 ● 可靠的测试环境 ● benchstat RBTree_PutWrong/size-100-8 14.2µs ± 3% RBTree_PutWrong/size-200-8 30.5µs ± 0% RBTree_PutWrong/size-300-8 47.0µs ± 0% RBTree_PutWrong/size-400-8 63.3µs ± 0% RBTree_PutWrong/size-500-8 79.6µs ± 0% RBTree_PutWrong/size-600-8 RBTree_PutWrong/size-600-8 97.3µs ± 0% RBTree_PutWrong/size-700-8 113µs ± 0% RBTree_PutWrong/size-800-8 131µs ± 0% RBTree_PutWrong/size-900-8 146µs ± 0% 2020 © Changkun Ou · Go 夜读 · 对 Go 程序进行可靠的性能测试 例 2:测试代码错误(续)0 码力 | 37 页 | 1.23 MB | 1 年前3
共 102 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11