Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWalker23 committed Nov 4, 2024
0 parents commit c29e6a4
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Algorithms CI

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Install dependencies
run: go mod download

- name: Run tests
run: go test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bin/
pkg/
.DS_Store
.vscode
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Algorithms Fourth Edition

Written in Go. If you want to colloborate, open a PR. All optimisations and feedback are welcome.

## To run:
```
go run main.go
```

## To Test:

```
go run test
```
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/JakeWalker23/algorithms

go 1.23.2
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

func Add(a, b int) int {
return a + b
}
12 changes: 12 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

import "testing"

func TestAdd(t *testing.T) {
result := Add(2, 3)
expected := 5

if result != expected {
t.Errorf("Add(2, 3) = %d; want %d", result, expected)
}
}

0 comments on commit c29e6a4

Please sign in to comment.