This document provides an overview of the Go programming language including:
- A brief history of Go from its origins at Google in 2007 to current widespread usage.
- Key features of Go like functions, structs, interfaces, methods, slices, pointers, go-routines and channels.
- Examples of basic Go code demonstrating functions, structs, methods, interfaces, concurrency with go-routines and channels.
- Discussion of things missing from Go like classes, generics and exceptions.
- Quotes from developers commenting both positively and negatively on Go's simplicity and tradeoffs.
- Links to further resources like the Go tour to learn more.
~10min dive to Python Asynchronous IO
HTML version (recommended): https://dl.dropboxusercontent.com/u/1565687/speak/Python3%20AsyncIO%20Horizon/index.html
Commit ускоривший python 2.7.11 на 30% и новое в python 3.5PyNSK
Автор доклада: Александр Сапронов.
Обзорный мини-доклад. В докладе вы найдете причину релиза 2.7.11 и новинки Python 3.5
Доклад сделан на 2 встрече сообщества PyNSK
Conférence des Geeks Anonymes sur " le langage Go ", par Thomas Hayen le 23 septembre 2020.
Cette conférence est disponible en vidéo sur Youtube : https://youtu.be/AlGGneVGTJk
~10min dive to Python Asynchronous IO
HTML version (recommended): https://dl.dropboxusercontent.com/u/1565687/speak/Python3%20AsyncIO%20Horizon/index.html
Commit ускоривший python 2.7.11 на 30% и новое в python 3.5PyNSK
Автор доклада: Александр Сапронов.
Обзорный мини-доклад. В докладе вы найдете причину релиза 2.7.11 и новинки Python 3.5
Доклад сделан на 2 встрече сообщества PyNSK
Conférence des Geeks Anonymes sur " le langage Go ", par Thomas Hayen le 23 septembre 2020.
Cette conférence est disponible en vidéo sur Youtube : https://youtu.be/AlGGneVGTJk
Euro python2011 High Performance PythonIan Ozsvald
I ran this as a 4 hour tutorial at EuroPython 2011 to teach High Performance Python coding.
Techniques covered include bottleneck analysis by profiling, bytecode analysis, converting to C using Cython and ShedSkin, use of the numerical numpy library and numexpr, multi-core and multi-machine parallelisation and using CUDA GPUs.
Write-up with 49 page PDF report: http://ianozsvald.com/2011/06/29/high-performance-python-tutorial-v0-1-from-my-4-hour-tutorial-at-europython-2011/
Go is a language developed by Google with multi-core in mind. Differ from other languages, concurrency is a first-class primitive in Go. This talk covers some useful patterns for dealing with concurrency.
In which Richard will tell you about some things you should never (probably ever) do to or in Python. Warranties may be voided. The recording of this talk is online at http://www.youtube.com/watch?v=H2yfXnUb1S4
Most computers today have multiple cores and processes. That means, if you really want to fully explore the capabilities of them, you must explore concurrent programming resources. Go was developed with this in mind, offering goroutines and channels.
Although concurrent programming may seem simple with Go, there are a couple of details to keep in mind, to avoid problems. In this talk, I’m going to show a couple of practical examples with goroutines and channels, and some common pitfalls
Java agents are pluggable self contained components that run embedded in a JVM and intercept the classloading process. They were introduced in Java 5 along with the powerful java.lang.instrument package. Java agents can be loaded statically at startup or dynamically (programmatically) at runtime to attach to a running process.
Java agents were an awesome addition to the JVM as it opened a lot of opportunities for tool designers and changed Java tooling landscape quite drastically. In conjunction with Java bytecode manipulation libraries it is now possible to do amazing things to Java classes: we can experiment with programming models, redefine classes at runtime, record execution flow, etc.
I’d like to give an overview of Java agents’ functionality along with the usage examples and real world experiences. You will learn, how to implement an agent and apply Instrumentation API in combination with bytecode manipulation libraries to solve interesting tasks.
Kotlin coroutine - the next step for RxJava developer?Artur Latoszewski
Kotlin is a language that is rapidly gaining popularity, among others thanks to cooperation with Java. On the other hand, RxJava has brought us many solutions to problems related to asynchronous code. If everything is so cool, do we need anything else in the Kotlin world? Is Kotlin Coroutine a competition for RxJava?
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQAFest
Our daily work is comprised of testing a product and improve its quality. However, here and there, we can come to a state where we find a need to build a tool, that can make our work easierbetter.
I will share from my experience when I found myself in a situation where building a tool was needed.
We will start with a web application that allows you to know when a food delivery you ordered arrives to the office, and then we will focus on a tool that test the performance of an app from the UI side. We will do a live demo for both of them.
Euro python2011 High Performance PythonIan Ozsvald
I ran this as a 4 hour tutorial at EuroPython 2011 to teach High Performance Python coding.
Techniques covered include bottleneck analysis by profiling, bytecode analysis, converting to C using Cython and ShedSkin, use of the numerical numpy library and numexpr, multi-core and multi-machine parallelisation and using CUDA GPUs.
Write-up with 49 page PDF report: http://ianozsvald.com/2011/06/29/high-performance-python-tutorial-v0-1-from-my-4-hour-tutorial-at-europython-2011/
Go is a language developed by Google with multi-core in mind. Differ from other languages, concurrency is a first-class primitive in Go. This talk covers some useful patterns for dealing with concurrency.
In which Richard will tell you about some things you should never (probably ever) do to or in Python. Warranties may be voided. The recording of this talk is online at http://www.youtube.com/watch?v=H2yfXnUb1S4
Most computers today have multiple cores and processes. That means, if you really want to fully explore the capabilities of them, you must explore concurrent programming resources. Go was developed with this in mind, offering goroutines and channels.
Although concurrent programming may seem simple with Go, there are a couple of details to keep in mind, to avoid problems. In this talk, I’m going to show a couple of practical examples with goroutines and channels, and some common pitfalls
Java agents are pluggable self contained components that run embedded in a JVM and intercept the classloading process. They were introduced in Java 5 along with the powerful java.lang.instrument package. Java agents can be loaded statically at startup or dynamically (programmatically) at runtime to attach to a running process.
Java agents were an awesome addition to the JVM as it opened a lot of opportunities for tool designers and changed Java tooling landscape quite drastically. In conjunction with Java bytecode manipulation libraries it is now possible to do amazing things to Java classes: we can experiment with programming models, redefine classes at runtime, record execution flow, etc.
I’d like to give an overview of Java agents’ functionality along with the usage examples and real world experiences. You will learn, how to implement an agent and apply Instrumentation API in combination with bytecode manipulation libraries to solve interesting tasks.
Kotlin coroutine - the next step for RxJava developer?Artur Latoszewski
Kotlin is a language that is rapidly gaining popularity, among others thanks to cooperation with Java. On the other hand, RxJava has brought us many solutions to problems related to asynchronous code. If everything is so cool, do we need anything else in the Kotlin world? Is Kotlin Coroutine a competition for RxJava?
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQAFest
Our daily work is comprised of testing a product and improve its quality. However, here and there, we can come to a state where we find a need to build a tool, that can make our work easierbetter.
I will share from my experience when I found myself in a situation where building a tool was needed.
We will start with a web application that allows you to know when a food delivery you ordered arrives to the office, and then we will focus on a tool that test the performance of an app from the UI side. We will do a live demo for both of them.
Краткое введение в Scala для разработчиков на других языках. Рассмотрены несколько простых программ, написанных с использованием красивых возможностей Scala.
Implicit conversions and implicit parameters are fundamental and unique features of Scala that are powerful at the same time. To use these features to their maximum potential, and do so with confidence, you have to understand the specifics of how Scala compiler’s implicits search works. I will cover this topic in details, including ways you can optimize the implicits search algorithm in your library.
The second part of my session will focus on IntelliJ IDEA and how to leverage your IDE for working with implicits. Among other helpful IDE features, I will show how to debug implicits in IntelliJ IDEA.
As examples we’ll take a look at a few Scala libraries, including Spray with its well-known Magnet pattern.
On top of that, during my talk I’ll show you a few new tips and tricks on how to be more efficient by using IntelliJ IDEA’s hidden gems when working with Scala. "
The async/await concurrency pattern in GolangMatteo Madeddu
In this talk, I spoke about parallelism and concurrency and how you can achieve the same behavioral pattern you can achieve with Node.js using await/async statements, using goroutines and channels with Golang.
Why we are submitting this talk? Because Go is cool and we would like to hear more about this language ;-). In this talk we would like to tell you about our experience with development of microservices with Go. Go enables devs to create readable, fast and concise code, this - beyond any doubt is important. Apart from this we would like to leverage our test driven habbits to create bulletproof software. We will also explore other aspects important for adoption of a new language.
Golang basics for Java developers - Part 1Robert Stern
A short overview of Golang with Java comparison.
Part 1 of the series "Microservice development with Golang".
Contains hints and example links for potential Gophers
TeamCity is a great tool for Continuous Integration with a lot of advanced features provided out-of-the-box. In this session, we will go through how TeamCity helps the software development with the daily routine; what was added to the product in the latest releases; and what features are coming next.
You will learn why build pipelines are useful, and how the CI server can be optimized when properly configured. I will also demonstrate how to configure the builds using the special Kotlin DSL provided with TeamCity.
Devoxx Ukraine 2018 - Kotlin DSL in under an hourAnton Arhipov
Kotlin DSLLearn how to create type-safe and statically typed DSLs in Kotlin. Uncover the language features that make DSL creation possible. We’ll take a look at a few practical examples and create a simple DSL ourselves.
TestContainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingAnton Arhipov
In Java, a typical workflow involves restarting the application with (almost) every class change. For some applications, it is not a problem at all; for others, it is a disaster, from HotSwap to agent-based reloading. This session takes a look at the options available for Java class reloading. There are plenty of tools you can use for this task: rely on standard JVM HotSwap, redesign your application to rely on dynamic class loaders, comprehend the Zen of OSGi, or integrate a reloading agent. Every option has its own drawbacks and benefits, and the presentation takes a deep dive into the subject. Come get a better understanding of class reloading technologies and become a more productive Java developer.
GeeCON 2017 - TestContainers. Integration testing without the hassleAnton Arhipov
TestContainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
JEEConf 2017 - The hitchhiker’s guide to Java class reloadingAnton Arhipov
In Java, a typical workflow involves restarting the application (almost) with every class change. For some applications it is not a problem at all, for some – it is a disaster.
From HotSwap to agent-based reloading. In this session, we are going to take a look at the options available for Java class reloading. There is plenty of tools that you can use for this task: rely on standard JVM HotSwap, redesign your application to rely on dynamic class loaders, to comprehend the Zen of OSGi, or to integrate a reloading agent. Every option has its own drawbacks and benefits and we’re going to take a deep dive on the subject.
Finally, there are also the conceptual challenges in reloading Java classes. What to do with the state? What should happen with the static initialisers? What if super class changes? Join this session to gain a better understanding of class reloading technologies and become more productive Java developer.
JEEConf 2017 - Having fun with JavassistAnton Arhipov
Javassist makes Java bytecode manipulation simple. At ZeroTurnaround we use Javassist a lot to implement the integrations for our tools.
In this talk we will go through the examples of how Javassist can be applied to alter the applications behavior and do all kind of fun stuff with it.
Why is it interesting? Because while trying to do unusual things in Java, you learn much more about the language and the platform itself and learning about Javassist will actually make you a better Java developer!
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
5. “Can't reach the pedals. no brakes.
gaining speed. eyes bulging in horror.
technical debt crash eminent. “
— Tim Dysinger, @dysinger
6. Paul Phillips
@extempore2
“go is a terrible, terrible language, yet
still a major productivity boost.
Amdahl's law in another context.”
“You often see languages which are
fighting the last war. Go is fighting
the War of 1812.”
7. “reduce: what you will do with your
expectations after you start with Go”
“Rust and Scala drown you in
complexity. Go drowns you in
simplicity.”
Paul Phillips
@extempore2
19. func main() {
fmt.Println("1 + 2 =", add(1, 2))
}
func add(a int, b int) int {
return a + b
}
Functions
20. func main() {
fmt.Println("1 + 2 =", add(1, 2))
}
func add(a int, b int) int {
return a + b
}
Functions
21. func main() {
fmt.Println("1 + 2 =", add(1, 2))
}
func add(a, b int) int {
return a + b
}
Functions
22. func main() {
s, p := calculate(1, 2)
fmt.Printf("1+2=%d, 1*2=%d", s, p)
}
func calculate(a, b int) (int, int) {
return a + b, a * b
}
Functions
23. func main() {
s, p := calculate(1, 2)
fmt.Printf("1+2=%d, 1*2=%d", s, p)
}
func calculate(a, b int) (int, int) {
return a + b, a * b
}
Functions
24. func main() {
s, p := calculate(1, 2)
fmt.Printf("1+2=%d, 1*2=%d", s, p)
}
func calculate(a, b int) (s, p int) {
s := a + b
p := a * b
return
}
Functions
25. func main() {
double := func(a int) int {
return a * 2
}
double(14)
}
Functions as values
26. func main() {
double := factory()
double(14)
}
func factory() func(a int) int {
return func(a int) int {
return a * 2
}
}
Functions as values
27. Arrays
var a [4]int
a[0] = 1
i := a[0]
http://blog.golang.org/go-slices-usage-and-internals
arr := [2]string{"Foo", "Bar"}
arr := […]string{"Foo", "Bar"}
28. Slices
a := []int{1, 2, 3} // [1 2 3]
No size definition
b := append(a, 4, 5) // [1 2 3 4 5]
c := make(c, 3) // [0 0 0]
d := b[1:3] // [2 3]
e := b[:3] // [1 2 3]
46. func ready(w string, sec int) {
time.Sleep(time.Duration(sec) * time.Second)
fmt.Println(w, "is ready!")
}
func main() {
go ready("Tea", 2)
go ready("Coffee", 1)
fmt.Println("I'm waiting")
time.Sleep(5 * time.Second)
}
I’m waiting
Coffee is ready
Tea is ready
47. Channels
ci := make(chan int)
cs := make(chan string)
cf := make(chan interface{})
ci <- 1 ← send value 1 into channel ci
i := <-ci ← read int from channel ci
48. var c chan int
func ready(w string, sec int) {
time.Sleep(time.Duration(sec) * time.Second)
fmt.Println(w, "is ready!”)
с <-‐ 1
}
func main() {
go ready("Tea", 2)
go ready("Coffee", 1)
fmt.Println("I'm waiting")
<-‐c
<-‐c
}
49. var done = make(chan bool)
var msgs = make(chan int)
func produce() {
for i := 0; i < 10; i++ {
msgs <-‐ i
}
done <-‐ true
}
func consume() {
for {
msg := <-‐msgs
println(msg)
}
}
func main() {
go produce()
go consume()
<-‐ done
}
50. var done = make(chan bool)
var msgs = make(chan int)
func produce() {
for i := 0; i < 10; i++ {
msgs <-‐ i
}
done <-‐ true
}
func consume() {
for {
msg := <-‐msgs
println(msg)
}
}
func main() {
go produce()
go consume()
<-‐ done
}
Start go-‐routines
51. var done = make(chan bool)
var msgs = make(chan int)
func produce() {
for i := 0; i < 10; i++ {
msgs <-‐ i
}
done <-‐ true
}
func consume() {
for {
msg := <-‐msgs
println(msg)
}
}
func main() {
go produce()
go consume()
<-‐ done
}
Send values
52. var done = make(chan bool)
var msgs = make(chan int)
func produce() {
for i := 0; i < 10; i++ {
msgs <-‐ i
}
done <-‐ true
}
func consume() {
for {
msg := <-‐msgs
println(msg)
}
}
func main() {
go produce()
go consume()
<-‐ done
}
Receive values and print
53. var done = make(chan bool)
var msgs = make(chan int)
func produce() {
for i := 0; i < 10; i++ {
msgs <-‐ i
}
done <-‐ true
}
func consume() {
for {
msg := <-‐msgs
println(msg)
}
}
func main() {
go produce()
go consume()
<-‐ done
}
Done!
60. What’s missing?
Debugger
IntelliJ IDEA plugin is still in development
Can use GDB, but better do something else instead
Dependency management
A lot of different solutions, no de facto standard
-vendor option in 1.5
62. Testing
package math
func Add(a, b int) int {
return a + b
} package math
import "testing"
func TestAdd(t *testing.T){
if Add(1, 3) != 4 {
t.Error("Expecting 4")
}
}
63. Testing
package math
func Add(a, b int) int {
return a + b
} package math
import "testing"
func TestAdd(t *testing.T){
if Add(1, 3) != 4 {
t.Error("Expecting 4")
}
}
/usr/local/go/bin/go test -‐v ./... -‐run ^TestAdd$
Testing started at 03:35 ...
? _/Users/anton/work-‐src/mygo [no test files]PASS
ok _/Users/anton/work-‐src/mygo/math 0.007s
64. Q: Can you build the enterprise apps in Go?
And now a million $$ question
https://www.youtube.com/watch?v=cFJkLfujOts
Building bank in Go:
A: Apparently, you can :)
65. Can I haz
decimal type?
https://github.com/shopspring/decimal
import "github.com/shopspring/decimal"
…
x, _ := decimal.NewFromString("0.1")
sum := x.Add(x).Add(x) // 0.3
67. Frameworks
Gorilla web toolkit http://www.gorillatoolkit.org/
Go-Kit http://gokit.io
List of various frameworks and libraries:
https://github.com/avelino/awesome-go