update: directory structure

This commit is contained in:
Inanc Gumus
2019-08-25 20:58:36 +03:00
parent 0f07e4814e
commit 912d789933
74 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,53 @@
// For more tutorials: https://blog.learngoprogramming.com
//
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
package main
import (
"fmt"
"os"
"github.com/inancgumus/learngo/magic"
//
// Use the following one for the panicking library:
// magic "github.com/inancgumus/learngo/magicpanic"
//
)
func main() {
files := []string{
"pngs/cups-jpg.png",
"pngs/forest-jpg.png",
"pngs/golden.png",
"pngs/work.png",
"pngs/shakespeare-text.png",
"pngs/empty.png",
}
args := os.Args[1:]
if len(args) != 1 {
fmt.Println("png or jpg?")
return
}
list(args[0], files)
// fmt.Println("catch me if you can!")
}
func list(format string, files []string) {
valids, err := magic.Detect(format, files)
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("Correct Files:\n")
for _, valid := range valids {
fmt.Printf(" + %s\n", valid)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1,12 @@
come night come romeo come thou day in night
for thou wilt lie upon the wings of night
whiter than new snow on a raven's back
come gentle night come loving black-browed night
give me my romeo and when he shall die
take him and cut him out in little stars
and he will make the face of heaven so fine
that all the world will be in love with night
and pay no worship to the garish sun
oh i have bought the mansion of love
but not possessed it and though i am sold
not yet enjoyed

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB