// SetFormat writes the magic values necessary for specified format
// and then updates the checksum accordingly.
184938
func (b *block) SetFormat(format Format) {
	// Set the magic values.
	switch {
	case format.has(formatV7):
		// Do nothing.
	case format.has(FormatGNU):
		copy(b.GNU().Magic(), magicGNU)
		copy(b.GNU().Version(), versionGNU)
	case format.has(formatSTAR):
		copy(b.STAR().Magic(), magicUSTAR)
		copy(b.STAR().Version(), versionUSTAR)
		copy(b.STAR().Trailer(), trailerSTAR)
	case format.has(FormatUSTAR | FormatPAX):
		copy(b.USTAR().Magic(), magicUSTAR)
		copy(b.USTAR().Version(), versionUSTAR)
	default:
		panic("invalid format")
	}

	// Update checksum.
	// This field is special in that it is terminated by a NULL then space.
	var f formatter
	field := b.V7().Chksum()
	chksum, _ := b.ComputeChecksum() // Possible values are 256..128776
	f.formatOctal(field[:7], chksum) // Never fails since 128776 < 262143
	field[7] = ' '
}
311262
func (s *GetHLSStreamingSessionURLInput) SetContainerFormat(v string) *GetHLSStreamingSessionURLInput {
	s.ContainerFormat = &v
	return s
}
1250500
func (il IfLogger) SetFormatter(f Formatter) ContextLogger {
	return &contextLogger{
		isTrue:    il.ok(),
		formatter: f,
	}
}
350756
func (l *Logger) SetLogFormat(logFormat string) *Logger {
	l.mu.Lock()
	defer l.mu.Unlock()
	l.lf = logFormat
	return l
}
305949
func (s *StorageDescriptor) SetOutputFormat(v string) *StorageDescriptor {
	s.OutputFormat = &v
	return s
}
312208
func (s *CloudWatchLogsLogStream) SetDatetimeFormat(v string) *CloudWatchLogsLogStream {
	s.DatetimeFormat = &v
	return s
}
1294483
func (k *KeyReadWriter) SetKeyFormatter(kf keyutils.Formatter) {
	k.mu.Lock()
	defer k.mu.Unlock()
	k.keyFormatter = kf
}
251084
func (logger *Logger) SetFormatter(formatter lg.Formatter) {
	unsafeStd := (*unsafe.Pointer)(unsafe.Pointer(&logger.std))
	old := logger.std
	logger.std.Formatter = formatter
	atomic.CompareAndSwapPointer(unsafeStd, unsafe.Pointer(old), unsafe.Pointer(logger.std))
}
590067
func (s *GetThreatIntelSetOutput) SetFormat(v string) *GetThreatIntelSetOutput {
	s.Format = &v
	return s
}
1282594
func (l *Logger) SetTimeFormat(timeFormat string) *Logger {
	l.mu.Lock()
	defer l.mu.Unlock()
	l.tf = timeFormat
	return l
}
845184
func (s *StorageDescriptor) SetInputFormat(v string) *StorageDescriptor {
	s.InputFormat = &v
	return s
}
226778
func (s *DocumentDescription) SetDocumentFormat(v string) *DocumentDescription {
	s.DocumentFormat = &v
	return s
}
222157
func (b *MultiHandler) SetFormatter(f Formatter) {
	for _, h := range b.handlers {
		h.SetFormatter(f)
	}
}
353832
func (s *ExtendedS3DestinationDescription) SetCompressionFormat(v string) *ExtendedS3DestinationDescription {
	s.CompressionFormat = &v
	return s
}
1260759
func (s *CaptionFormat) SetFormat(v string) *CaptionFormat {
	s.Format = &v
	return s
}
973534
func (s *RedshiftSettings) SetTimeFormat(v string) *RedshiftSettings {
	s.TimeFormat = &v
	return s
}
1289361
func (s *TerminologyData) SetFormat(v string) *TerminologyData {
	s.Format = &v
	return s
}