File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Lint
2+
3+ on :
4+ push :
5+
6+ permissions :
7+ contents : read
8+
9+ jobs :
10+ golangci-lint :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v3
14+ - uses : actions/setup-go@v4
15+ with :
16+ go-version : ' 1.20'
17+ - name : Setup libtensorflow
18+ run : script/install-libtensorflow
19+ - uses : golangci/golangci-lint-action@v3
20+ with :
21+ version : v1.52.2
Original file line number Diff line number Diff line change 1+ name : Test
2+
3+ on :
4+ push :
5+
6+ permissions :
7+ contents : read
8+
9+ jobs :
10+ gotest :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v3
14+ - uses : actions/setup-go@v4
15+ with :
16+ go-version : ' 1.20'
17+ - name : Setup libtensorflow
18+ run : script/install-libtensorflow
19+ - name : Test
20+ uses : robherley/go-test-action@v0.1.0
21+ with :
22+ omitUntestedPackages : true
Original file line number Diff line number Diff line change 11# guesslang-go 🔍
22
3+ [ ![ GoDoc] ( https://godoc.org/github.com/golang/gddo?status.svg )] ( https://pkg.go.dev/github.com/robherley/guesslang-go )
4+ [ ![ Test] ( https://github.com/robherley/guesslang-go/actions/workflows/test.yml/badge.svg )] ( https://github.com/robherley/guesslang-go/actions/workflows/test.yml )
5+
36Go port of [ yoeo/guesslang] ( https://github.com/yoeo/guesslang ) . Detects programming language of source code using a deep learning model.
47
58## Setup
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This script downloads and installs libtensorflow (CPU only) for the current platform.
4+ # If you are on macOS, you can just use `brew install libtensorflow` instead.
5+ # https://www.tensorflow.org/install/lang_c
6+
7+ set -e
8+
9+ if [ " $( go env GOARCH) " != " amd64" ]; then
10+ echo " unsupported architecture: $ARCH "
11+ exit 1
12+ fi
13+
14+ OS=$( go env GOOS)
15+
16+ case " $OS " in
17+ darwin)
18+ brew install libtensorflow
19+ ;;
20+ linux)
21+ TENSORFLOW_VERSION=2.11.0
22+ ARCHIVE_PATH=$( mktemp -d) /tensorflow.tar.gz
23+ curl -o " $ARCHIVE_PATH " " https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-${OS} -x86_64-${TENSORFLOW_VERSION} .tar.gz"
24+ sudo tar -xzf " $ARCHIVE_PATH " -C /usr/local
25+ sudo ldconfig /usr/local/lib
26+ rm -rf " $ARCHIVE_PATH "
27+ ;;
28+ * )
29+ echo " unsupported OS: $OS "
30+ exit 1
31+ ;;
32+ esac
You can’t perform that action at this time.
0 commit comments