Skip to content

Commit

Permalink
refactor(project): reorganize project structure
Browse files Browse the repository at this point in the history
squash me baby
  • Loading branch information
nezutero committed Aug 14, 2024
1 parent 6daac82 commit 4523e4a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2 align="center">network scanner using golang</h2>
<h2 align="center">port scanner using golang</h2>

###

Expand All @@ -11,17 +11,15 @@
## project structure:

```
├── go.mod
├── main.go
└── README.md
```

## installation

- use go get:

```
go get github.com/kenjitheman/ntwrkscan
go get github.com/nezutero/portscan
```

## contributing
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module main.go
module github.com/nezutero/portscan

go 1.20
7 changes: 2 additions & 5 deletions main.go → portscan.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package portscan

import (
"fmt"
Expand All @@ -17,10 +17,7 @@ func scanPort(targetIP string, port int, timeout time.Duration) bool {
return true
}

func main() {
targetIP := "192.168.1.1" // your target IP
timeout := 2 * time.Second

func StartPortScan(targetIP string, timeout time.Duration) {
for port := 1; port <= 65535; port++ {
if scanPort(targetIP, port, timeout) {
fmt.Printf("[SUCCESS] port %d is open\n", port)
Expand Down

0 comments on commit 4523e4a

Please sign in to comment.