mirror of
https://github.com/go-gitea/gitea.git
synced 2024-08-29 23:57:30 +02:00
* Dropped unused codekit config * Integrated dynamic and static bindata for public * Ignore public bindata * Add a general generate make task * Integrated flexible public assets into web command * Updated vendoring, added all missiong govendor deps * Made the linter happy with the bindata and dynamic code * Moved public bindata definition to modules directory * Ignoring the new bindata path now * Updated to the new public modules import path * Updated public bindata command and drop the new prefix
21 lines
672 B
Go
21 lines
672 B
Go
//+build !unsafe
|
|
|
|
// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.
|
|
// Use of this source code is governed by a MIT license found in the LICENSE file.
|
|
|
|
package codec
|
|
|
|
// stringView returns a view of the []byte as a string.
|
|
// In unsafe mode, it doesn't incur allocation and copying caused by conversion.
|
|
// In regular safe mode, it is an allocation and copy.
|
|
func stringView(v []byte) string {
|
|
return string(v)
|
|
}
|
|
|
|
// bytesView returns a view of the string as a []byte.
|
|
// In unsafe mode, it doesn't incur allocation and copying caused by conversion.
|
|
// In regular safe mode, it is an allocation and copy.
|
|
func bytesView(v string) []byte {
|
|
return []byte(v)
|
|
}
|