An open API service indexing awesome lists of open source software.

https://github.com/wenerme/go-magic

libmagic in golang
https://github.com/wenerme/go-magic

cgo cgo-bindings go golang libmagic

Last synced: 2 months ago
JSON representation

libmagic in golang

Awesome Lists containing this project

README

          

# go-magic

[![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![Go Report Card][report-card-img]][report-card]

[doc-img]: https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square
[doc]: https://pkg.go.dev/github.com/wenerme/go-magic?tab=doc
[ci-img]: https://github.com/wenerme/go-magic/actions/workflows/ci.yml/badge.svg
[ci]: https://github.com/wenerme/go-magic/actions/workflows/ci.yml
[cov-img]: https://codecov.io/gh/wenerme/go-magic/branch/main/graph/badge.svg
[cov]: https://codecov.io/gh/wenerme/go-magic/branch/main
[report-card-img]: https://goreportcard.com/badge/github.com/wenerme/go-magic
[report-card]: https://goreportcard.com/report/github.com/wenerme/go-magic

libmagic Golang binding.

## Alternative

- go [net/http#DetectContentType](https://pkg.go.dev/net/http#DetectContentType)
- whatwg [mimesniff](https://mimesniff.spec.whatwg.org/)
- pure go [h2non/filetype](https://github.com/h2non/filetype)
- [adrian-thurston/ragel](https://github.com/adrian-thurston/ragel)

## Reference

- [magic_open.3](https://man7.org/linux/man-pages/man3/magic_open.3.html)