INTERNAL
Hack Your Career
Winter Semester 2018/19
2INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Hack Your Carrer Offer
• Workshops and Lectures
• Team Hack – vacation internship
https://www.facebook.com/Hack.your.Career/
Hackin’ Gliwice
http://hackingliwice.pl/
Gophers Silesia
https://www.meetup.com/GophersSilesia/
Gliwice Software Bar Camp
https://www.meetup.com/Gliwice-Software-
BarCamp/
3INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Tomasz Pietrek
tomasz.Pietrek@sap.com
4INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Co to jest GO
5INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Czym jest GO?
• Język programowania stworzony przez Google
6INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Czym jest GO?
• Język programowania stworzony przez Google
• Do rozwiązywania ich własnych problemów
7INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Czym jest GO?
• Język programowania stworzony przez Google
• Do rozwiązywania ich własnych problemów
• A problemy google są często ogromne
8INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Jakie problemy go rozwiązuje?
9INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Jakie problem GO rozwiązuje?
• Skraca czas budowania kodu źródłowego
10INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Jakie problem GO rozwiązuje?
• Skraca czas budowania kodu źródłowego
• Jest łatwy do nauczenia się
11INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Jakie problem GO rozwiązuje?
• Skraca czas budowania kodu źródłowego
• Jest łatwy do nauczenia się
• Bardzo dobrze się skaluje
12INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Jakie problem GO rozwiązuje?
• Skraca czas budowania kodu źródłowego
• Jest łatwy do nauczenia się
• Bardzo dobrze się skaluje
• W prosty I wydajny sposób rozwiązuję problem współbiezności
13INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Na czym polega programowanie?
14INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Czym jest programowanie?
• Szczegółowy plan dojazdu do określonego miejsca.
15INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Czym jest programowanie?
• Szczegółowy plan dojazdu do określonego miejsca.
• Z wzięciem pod uwagi zmiany trasy w razie wystąpienia korków
16INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Czym jest programowanie?
• Szczegółowy plan dojazdu do określonego miejsca.
• Z wzięciem pod uwagi zmiany trasy w razie wystąpienia korków lub zamkniętej drogi
• Czasem z koniecznością wyjaśnienia po której stronie ulicy trzeba jechać
17INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Czym jest programowanie?
• Szczegółowy plan dojazdu do określonego miejsca.
• Z wzięciem pod uwagi zmiany trasy w razie wystąpienia korków lub zamkniętej drogi
• Czasem z koniecznością wyjaśnienia po której stronie ulicy trzeba jechać
• Lub nawet jak działa kierownica i pedały gazu, sprzęgła i hamulec
18INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Czym jest programowanie?
• Szczegółowy plan dojazdu do określonego miejsca.
• Z wzięciem pod uwagi zmiany trasy w razie wystąpienia korków lub zamkniętej drogi
• Czasem z koniecznością wyjaśnienia po której stronie ulicy trzeba jechać
• Lub nawet jak działa kierownica i pedały gazu, sprzęgła i hamulec
A potem dacie te instrukcje klientowi, a on powie, że wszystko super,
ale ta instrukcja ma też działać dla pilotów poduszkowców.
19INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
No to poprogramujmy
20INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Pierwsze kroki
21INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Pierwsze kroki
22INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Pierwsze kroki
23INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Pierwsze kroki
24INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Pierwsze kroki
25INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Operacje
26INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Operacje
27INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Operacje
28INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Paczki
29INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
paczki
Nie chcemy za każym razem pisać całego kodu od zera.
Chcemy móc użyć możliwości dostarczonych przez innych (zwłaszcza od twórców samego języka)
30INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
paczki
31INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Zmienne
32INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Zmienne
Zmienne w go maja:
• Nazwę
• Wartość
• Typ
33INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Zmienne
Zmienne w go maja:
• Nazwę
• Wartość
• Typ
34INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Zmienne
35INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Zadanie
Hello world wyprintowane ze zmiennej
36INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Zmienne
Zmienne mogą mieć kilka podstawowych typów:
• string – ciąg znaków
• int – liczba całkowita
• float – liczba rzeczywista
• bool – prawda / fałsz
37INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Zmienne
Podstawowych typów jest tak naprawde znacznie więcej:
38INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Zmienne
39INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Zmienne
Wnioskowanie typów
40INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Warunki
41INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Warunki
42INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Funkcje
43INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Funkcje
44INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Funkcje
45INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Funkcje
keyword
Nazwa funkcji
Argumenty I ich typ
Typ zwracanej wartości
Ciało funkcji
46INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Funkcje
keyword
Nazwa funkcji
Argumenty I ich typ
Typ zwracanej wartości
Zwracana wartość
47INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Funkcje
Funkcja w GO może zwracać wiele wartości
48INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Tablice i slice’y
49INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
tablice
50INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Slice’y
51INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Slice’y
52INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Slice’y
53INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Maps
54INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
mapy
55INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Struktury
56INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Struktury
57INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Struktury - metody
58INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Wskaźniki (ojej)
59INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
wskaźniki
Wartość zmiennych wskaźnikowych przechowują adres
do miejsca w pamięci, gdzie dana wartość jest przechowana.
60INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
wskaźniki
Po co nam te całe wskaźniki?
61INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
wskaźniki
Po co nam te całe wskaźniki?
62INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
wskaźniki
Po co nam te całe wskaźniki?
63INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
wskaźniki
64INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Loops
65INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
pętle
66INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
pętle
67INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
Switch
68INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
switch
69INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
switch
70INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
goroutines
71INTERNAL© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ
goroutines

Introtogo

  • 1.
  • 2.
    2INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Hack Your Carrer Offer • Workshops and Lectures • Team Hack – vacation internship https://www.facebook.com/Hack.your.Career/ Hackin’ Gliwice http://hackingliwice.pl/ Gophers Silesia https://www.meetup.com/GophersSilesia/ Gliwice Software Bar Camp https://www.meetup.com/Gliwice-Software- BarCamp/
  • 3.
    3INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Tomasz Pietrek tomasz.Pietrek@sap.com
  • 4.
    4INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Co to jest GO
  • 5.
    5INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Czym jest GO? • Język programowania stworzony przez Google
  • 6.
    6INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Czym jest GO? • Język programowania stworzony przez Google • Do rozwiązywania ich własnych problemów
  • 7.
    7INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Czym jest GO? • Język programowania stworzony przez Google • Do rozwiązywania ich własnych problemów • A problemy google są często ogromne
  • 8.
    8INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Jakie problemy go rozwiązuje?
  • 9.
    9INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Jakie problem GO rozwiązuje? • Skraca czas budowania kodu źródłowego
  • 10.
    10INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Jakie problem GO rozwiązuje? • Skraca czas budowania kodu źródłowego • Jest łatwy do nauczenia się
  • 11.
    11INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Jakie problem GO rozwiązuje? • Skraca czas budowania kodu źródłowego • Jest łatwy do nauczenia się • Bardzo dobrze się skaluje
  • 12.
    12INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Jakie problem GO rozwiązuje? • Skraca czas budowania kodu źródłowego • Jest łatwy do nauczenia się • Bardzo dobrze się skaluje • W prosty I wydajny sposób rozwiązuję problem współbiezności
  • 13.
    13INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Na czym polega programowanie?
  • 14.
    14INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Czym jest programowanie? • Szczegółowy plan dojazdu do określonego miejsca.
  • 15.
    15INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Czym jest programowanie? • Szczegółowy plan dojazdu do określonego miejsca. • Z wzięciem pod uwagi zmiany trasy w razie wystąpienia korków
  • 16.
    16INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Czym jest programowanie? • Szczegółowy plan dojazdu do określonego miejsca. • Z wzięciem pod uwagi zmiany trasy w razie wystąpienia korków lub zamkniętej drogi • Czasem z koniecznością wyjaśnienia po której stronie ulicy trzeba jechać
  • 17.
    17INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Czym jest programowanie? • Szczegółowy plan dojazdu do określonego miejsca. • Z wzięciem pod uwagi zmiany trasy w razie wystąpienia korków lub zamkniętej drogi • Czasem z koniecznością wyjaśnienia po której stronie ulicy trzeba jechać • Lub nawet jak działa kierownica i pedały gazu, sprzęgła i hamulec
  • 18.
    18INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Czym jest programowanie? • Szczegółowy plan dojazdu do określonego miejsca. • Z wzięciem pod uwagi zmiany trasy w razie wystąpienia korków lub zamkniętej drogi • Czasem z koniecznością wyjaśnienia po której stronie ulicy trzeba jechać • Lub nawet jak działa kierownica i pedały gazu, sprzęgła i hamulec A potem dacie te instrukcje klientowi, a on powie, że wszystko super, ale ta instrukcja ma też działać dla pilotów poduszkowców.
  • 19.
    19INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ No to poprogramujmy
  • 20.
    20INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Pierwsze kroki
  • 21.
    21INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Pierwsze kroki
  • 22.
    22INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Pierwsze kroki
  • 23.
    23INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Pierwsze kroki
  • 24.
    24INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Pierwsze kroki
  • 25.
    25INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Operacje
  • 26.
    26INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Operacje
  • 27.
    27INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Operacje
  • 28.
    28INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Paczki
  • 29.
    29INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ paczki Nie chcemy za każym razem pisać całego kodu od zera. Chcemy móc użyć możliwości dostarczonych przez innych (zwłaszcza od twórców samego języka)
  • 30.
    30INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ paczki
  • 31.
    31INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Zmienne
  • 32.
    32INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Zmienne Zmienne w go maja: • Nazwę • Wartość • Typ
  • 33.
    33INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Zmienne Zmienne w go maja: • Nazwę • Wartość • Typ
  • 34.
    34INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Zmienne
  • 35.
    35INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Zadanie Hello world wyprintowane ze zmiennej
  • 36.
    36INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Zmienne Zmienne mogą mieć kilka podstawowych typów: • string – ciąg znaków • int – liczba całkowita • float – liczba rzeczywista • bool – prawda / fałsz
  • 37.
    37INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Zmienne Podstawowych typów jest tak naprawde znacznie więcej:
  • 38.
    38INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Zmienne
  • 39.
    39INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Zmienne Wnioskowanie typów
  • 40.
    40INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Warunki
  • 41.
    41INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Warunki
  • 42.
    42INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Funkcje
  • 43.
    43INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Funkcje
  • 44.
    44INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Funkcje
  • 45.
    45INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Funkcje keyword Nazwa funkcji Argumenty I ich typ Typ zwracanej wartości Ciało funkcji
  • 46.
    46INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Funkcje keyword Nazwa funkcji Argumenty I ich typ Typ zwracanej wartości Zwracana wartość
  • 47.
    47INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Funkcje Funkcja w GO może zwracać wiele wartości
  • 48.
    48INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Tablice i slice’y
  • 49.
    49INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ tablice
  • 50.
    50INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Slice’y
  • 51.
    51INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Slice’y
  • 52.
    52INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Slice’y
  • 53.
    53INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Maps
  • 54.
    54INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ mapy
  • 55.
    55INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Struktury
  • 56.
    56INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Struktury
  • 57.
    57INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Struktury - metody
  • 58.
    58INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Wskaźniki (ojej)
  • 59.
    59INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ wskaźniki Wartość zmiennych wskaźnikowych przechowują adres do miejsca w pamięci, gdzie dana wartość jest przechowana.
  • 60.
    60INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ wskaźniki Po co nam te całe wskaźniki?
  • 61.
    61INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ wskaźniki Po co nam te całe wskaźniki?
  • 62.
    62INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ wskaźniki Po co nam te całe wskaźniki?
  • 63.
    63INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ wskaźniki
  • 64.
    64INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Loops
  • 65.
    65INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ pętle
  • 66.
    66INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ pętle
  • 67.
    67INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ Switch
  • 68.
    68INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ switch
  • 69.
    69INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ switch
  • 70.
    70INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ goroutines
  • 71.
    71INTERNAL© 2017 SAPSE or an SAP affiliate company. All rights reserved. ǀ goroutines