Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zkoppert/go-exercises
random go exercises to learn golang
https://github.com/zkoppert/go-exercises
golang golang-examples
Last synced: about 1 month ago
JSON representation
random go exercises to learn golang
- Host: GitHub
- URL: https://github.com/zkoppert/go-exercises
- Owner: zkoppert
- License: apache-2.0
- Created: 2020-11-11T04:45:34.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-12T23:49:52.000Z (about 4 years ago)
- Last Synced: 2024-05-02T06:02:21.352Z (8 months ago)
- Topics: golang, golang-examples
- Language: Go
- Homepage:
- Size: 44.9 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# go-exercises
![CodeQL](https://github.com/zkoppert/go-exercises/workflows/CodeQL/badge.svg) ![Go build](https://github.com/zkoppert/go-exercises/workflows/Go%20build/badge.svg) ![Lint Code Base](https://github.com/zkoppert/go-exercises/workflows/Lint%20Code%20Base/badge.svg)
## fizzbuzz
**Problem**Print the numbers from 1 to 20. However
- if the number is divisible by 3 (say, 9), print the word "fizz" instead of the number.
- if the number is divisible by 5 (say, 10), print the word "buzz" instead of the number.
- if the number is divisible by both 3 and 5 (say, 15) print "fizz buzz" instead of the number.[Solution](fizzbuzz/fizzbuzz.go)
## even-ended numbers
**Problem**An even-ended number is a number with the same first and last digits (ex: 1, 11, 121)
How many even ended numbers result from multiplying two four-digit numbers?[Solution](even-end/even-end.go)
## Maximal value
**Problem**Given an unordered slice of values called nums, print the maximal value in the slice.
[Solution](max-val/max-val.go)
## Word Count
**Problem**Given some text, print out how many times each word appears in the text. This should count while being case insensitive.
[Solution](word-count/word-count.go)
## Get URL content type
**Problem**Write a function that gets a URL and returns the value of Content-Type response HTTP HEADER or error if a GET request cannot be performed.
[Solution](get-url-content-type/get-url-content-type.go)
## Circle
**Problem**Define a circle struct which has two fields, centerof type point and length of type int. Also create a function the creates circle and returns a pointer to a new circle. A move method should also be created so that points can be moved, and an area method to calculate the area.
[Solution](circle/circle.go)