Skip to content

Commit

Permalink
v1.0.0 (#3)
Browse files Browse the repository at this point in the history
* chores: `go fmt`

* docs: update status badges

* spec: add missing specs

* spec: add missing specs

* chores: remove unsed code

* spec: add missing specs

* docs: update readme
  • Loading branch information
dineshgowda24 authored Oct 13, 2023
1 parent 5676eff commit 24d1df6
Show file tree
Hide file tree
Showing 13 changed files with 647 additions and 42 deletions.
26 changes: 5 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
# Browser

![](logo.png)

<div align="center">
<a href="https://github.com/dineshgowda24/browser/blob/main/LICENSE">
<img alt="License: Apache-2.0" src="https://img.shields.io/github/license/dineshgowda24/browser" />
</a>
<a href="https://pkg.go.dev/github.com/dineshgowda24/browser">
<img src="https://pkg.go.dev/badge/github.com/dineshgowda24/browser.svg" alt="Go Reference">
</a>
<a href="https://goreportcard.com/report/github.com/dineshgowda24/browser">
<img alt="Go report card" src="https://goreportcard.com/badge/github.com/dineshgowda24/browser" />
</a>
<a href="https://dl.circleci.com/status-badge/redirect/circleci/MQTLZJuBejHgr2yqrojz3u/5NTLeuQeViQw2JaPQf7gKa/tree/main">
<img alt="Build Status" src="https://dl.circleci.com/status-badge/img/circleci/MQTLZJuBejHgr2yqrojz3u/5NTLeuQeViQw2JaPQf7gKa/tree/main.svg?style=svg" />
</a>
<a href="https://codecov.io/gh/dineshgowda24/browser">
<img alt="Code coverage" src="https://codecov.io/gh/dineshgowda24/browser/graph/badge.svg?token=XUA2VJW5FU">
</a>
</div>
# browser [![MIT](https://img.shields.io/github/license/dineshgowda24/browser)](https://github.com/dineshgowda24/browser/blob/main/LICENSE) [![Go Reference](https://pkg.go.dev/badge/github.com/dineshgowda24/browser.svg)](https://pkg.go.dev/github.com/dineshgowda24/browser) [![Go report card](https://goreportcard.com/badge/github.com/dineshgowda24/browser)](https://goreportcard.com/report/github.com/dineshgowda24/browser) [![Build Status](https://dl.circleci.com/status-badge/img/circleci/MQTLZJuBejHgr2yqrojz3u/5NTLeuQeViQw2JaPQf7gKa/tree/main.svg?style=shield&circle-token=ab7a417fe410b8387c767f83568f7d2f2788ac4f)](https://dl.circleci.com/status-badge/redirect/circleci/MQTLZJuBejHgr2yqrojz3u/5NTLeuQeViQw2JaPQf7gKa/tree/main) [![Coverage](https://codecov.io/gh/dineshgowda24/browser/graph/badge.svg?token=XUA2VJW5FU)](https://codecov.io/gh/dineshgowda24/browser) [![X](https://img.shields.io/twitter/follow/_dineshgowda)](https://twitter.com/_dineshgowda)

<p align="center">
<img src="logo.png" width="125">
</p>

## Why?

Expand Down
7 changes: 1 addition & 6 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ func (b *Bot) Name() string {
return ""
}

n := b.matcher.Name()
if n != "" {
return n
}

return genericBotName
return b.matcher.Name()
}

// Why returns the reason why the user agent is a bot
Expand Down
11 changes: 2 additions & 9 deletions browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,8 @@ func NewBrowser(userAgent string) (*Browser, error) {
return nil, ErrUserAgentSizeExceeded
}

p, err := NewPlatform(userAgent)
if err != nil {
return nil, err
}

d, err := NewDevice(userAgent)
if err != nil {
return nil, err
}
p, _ := NewPlatform(userAgent)
d, _ := NewDevice(userAgent)

bot, err := NewBot(userAgent)
if err != nil {
Expand Down
Loading

0 comments on commit 24d1df6

Please sign in to comment.