Skip to content

Commit

Permalink
Merge pull request #4 for v0.2.2 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm authored Apr 23, 2017
2 parents f150d33 + 3368d72 commit 53c8316
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ branches:
- /^v[0-9]\.[0-9]/

go:
- 1.7.x
- 1.8
- 1.8.x
- tip
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# aruntime - aah framework
[![Build Status](https://travis-ci.org/go-aah/aruntime.svg?branch=master)](https://travis-ci.org/go-aah/aruntime) [![codecov](https://codecov.io/gh/go-aah/aruntime/branch/master/graph/badge.svg)](https://codecov.io/gh/go-aah/aruntime/branch/master) [![Go Report Card](https://goreportcard.com/badge/aahframework.org/aruntime.v0)](https://goreportcard.com/report/aahframework.org/aruntime.v0) [![Version](https://img.shields.io/badge/version-0.2.1-blue.svg)](https://github.com/go-aah/aruntime/releases/latest) [![GoDoc](https://godoc.org/aahframework.org/aruntime.v0?status.svg)](https://godoc.org/aahframework.org/aruntime.v0) [![License](https://img.shields.io/github/license/go-aah/aruntime.svg)](LICENSE)
[![Build Status](https://travis-ci.org/go-aah/aruntime.svg?branch=master)](https://travis-ci.org/go-aah/aruntime) [![codecov](https://codecov.io/gh/go-aah/aruntime/branch/master/graph/badge.svg)](https://codecov.io/gh/go-aah/aruntime/branch/master) [![Go Report Card](https://goreportcard.com/badge/aahframework.org/aruntime.v0)](https://goreportcard.com/report/aahframework.org/aruntime.v0) [![Version](https://img.shields.io/badge/version-0.2.2-blue.svg)](https://github.com/go-aah/aruntime/releases/latest) [![GoDoc](https://godoc.org/aahframework.org/aruntime.v0?status.svg)](https://godoc.org/aahframework.org/aruntime.v0) [![License](https://img.shields.io/github/license/go-aah/aruntime.svg)](LICENSE)

***v0.2.1 [released](https://github.com/go-aah/aruntime/releases/latest) and tagged on Apr 15, 2017***
***v0.2.2 [released](https://github.com/go-aah/aruntime/releases/latest) and tagged on Apr 23, 2017***

Runtime library is built to get, manipulate GoRoutines stack trace, etc.

*`aruntime` developed for aah framework. However, it's an independent library, can be used separately with any `Go` language project. Feel free to use it.*

# Installation
#### Stable Version - Production Ready
```sh
```bash
# install the library
go get -u aahframework.org/aruntime.v0
```

See official page [TODO]
Visit official website https://aahframework.org to learn more.
2 changes: 1 addition & 1 deletion aruntime.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
package aruntime

// Version no. of aah framework aruntime library
const Version = "0.2.1"
const Version = "0.2.2"
10 changes: 8 additions & 2 deletions stacktrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package aruntime

import (
"bufio"
"fmt"
"io"
"path/filepath"
Expand Down Expand Up @@ -93,10 +94,15 @@ func (st *Stacktrace) Parse() {
st.GoRoutines = make([]*GoRoutine, st.RoutineCnt)

ri := -1
lines := strings.Split(st.Raw, "\n")
gopathSrcLen := len(st.gopathSrc) + 1
gorootSrcLen := len(st.gorootSrc) + 1

var lines []string
scanner := bufio.NewScanner(strings.NewReader(st.Raw))
for scanner.Scan() {
lines = append(lines, scanner.Text())
}

for linePos := 0; linePos < len(lines); linePos++ {
sline := strings.TrimSpace(lines[linePos])
if len(sline) == 0 {
Expand All @@ -114,7 +120,7 @@ func (st *Stacktrace) Parse() {
continue
}

if strings.HasPrefix(sline, "/") {
if strings.HasPrefix(sline, "/") || strings.HasPrefix(sline[2:], "/") {
if strings.HasPrefix(sline, st.gopathSrc) {
sline = sline[gopathSrcLen:]
} else if strings.HasPrefix(sline, st.gorootSrc) {
Expand Down

0 comments on commit 53c8316

Please sign in to comment.